CWE-352
AllowedCross-Site Request Forgery (CSRF)
Abstraction: Compound · Status: Stable
The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.
14195 vulnerabilities reference this CWE, most recent first.
GHSA-H36P-9GCJ-J87V
Vulnerability from github – Published: 2025-09-22 21:30 – Updated: 2026-04-01 18:36Cross-Site Request Forgery (CSRF) vulnerability in LIJE Show Pages List allows Cross Site Request Forgery. This issue affects Show Pages List: from n/a through 1.2.0.
{
"affected": [],
"aliases": [
"CVE-2025-58219"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-09-22T19:16:06Z",
"severity": "MODERATE"
},
"details": "Cross-Site Request Forgery (CSRF) vulnerability in LIJE Show Pages List allows Cross Site Request Forgery. This issue affects Show Pages List: from n/a through 1.2.0.",
"id": "GHSA-h36p-9gcj-j87v",
"modified": "2026-04-01T18:36:14Z",
"published": "2025-09-22T21:30:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-58219"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/show-pages-list/vulnerability/wordpress-show-pages-list-plugin-1-2-0-cross-site-request-forgery-csrf-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-H39H-8H3C-F55J
Vulnerability from github – Published: 2025-04-24 18:31 – Updated: 2026-04-01 18:34Cross-Site Request Forgery (CSRF) vulnerability in nghialuu Zalo Official Live Chat allows Cross Site Request Forgery. This issue affects Zalo Official Live Chat: from n/a through 1.0.0.
{
"affected": [],
"aliases": [
"CVE-2025-46498"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-04-24T16:15:40Z",
"severity": "MODERATE"
},
"details": "Cross-Site Request Forgery (CSRF) vulnerability in nghialuu Zalo Official Live Chat allows Cross Site Request Forgery. This issue affects Zalo Official Live Chat: from n/a through 1.0.0.",
"id": "GHSA-h39h-8h3c-f55j",
"modified": "2026-04-01T18:34:57Z",
"published": "2025-04-24T18:31:07Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-46498"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/zalo-official-live-chat/vulnerability/wordpress-zalo-official-live-chat-1-0-0-cross-site-request-forgery-csrf-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-H3CX-P8JG-9MRC
Vulnerability from github – Published: 2025-10-31 12:30 – Updated: 2026-01-20 15:31Cross-Site Request Forgery (CSRF) vulnerability in Younes JFR. Advanced Database Cleaner advanced-database-cleaner allows Cross Site Request Forgery.This issue affects Advanced Database Cleaner: from n/a through <= 3.1.6.
{
"affected": [],
"aliases": [
"CVE-2025-64357"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-10-31T12:15:36Z",
"severity": "MODERATE"
},
"details": "Cross-Site Request Forgery (CSRF) vulnerability in Younes JFR. Advanced Database Cleaner advanced-database-cleaner allows Cross Site Request Forgery.This issue affects Advanced Database Cleaner: from n/a through \u003c= 3.1.6.",
"id": "GHSA-h3cx-p8jg-9mrc",
"modified": "2026-01-20T15:31:42Z",
"published": "2025-10-31T12:30:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-64357"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/Wordpress/Plugin/advanced-database-cleaner/vulnerability/wordpress-advanced-database-cleaner-plugin-3-1-6-cross-site-request-forgery-csrf-vulnerability?_s_id=cve"
},
{
"type": "WEB",
"url": "https://vdp.patchstack.com/database/Wordpress/Plugin/advanced-database-cleaner/vulnerability/wordpress-advanced-database-cleaner-plugin-3-1-6-cross-site-request-forgery-csrf-vulnerability"
},
{
"type": "WEB",
"url": "https://vdp.patchstack.com/database/Wordpress/Plugin/advanced-database-cleaner/vulnerability/wordpress-advanced-database-cleaner-plugin-3-1-6-cross-site-request-forgery-csrf-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-H3FG-H5V3-VF8M
Vulnerability from github – Published: 2022-01-06 18:33 – Updated: 2023-05-04 19:59Impact
CSRF vulnerability that allows a malicious site to add an item to the user's cart without their knowledge.
All solidus_frontend versions are affected. If you're using your own storefront, please, follow along to make sure you're not affected.
To reproduce the issue:
- Pick the id for a variant with available stock. From the rails console:
ruby
Spree::Variant.in_stock.pluck(:id)
Say we pick variant id 2.
- Launch your application, for instance, on
http://localhost:3000:
bash
bin/rails server
-
Open your browser dev tools.
-
Click on whatever link in your store.
-
Copy the value of the
Cookierequest header sent for the previous request from your browser dev tools. -
Execute the following, using your previously selected variant id and the value of the
Cookieheader (notice how it doesn't contain any authentication token):
bash
curl -X POST -d "variant_id=2&quantity=1" -H "Cookie: guest_token=eyJfcmFpbHMiOnsibWVzc2FnZSI6IklrWlRVMWRQWnpKMVZVdFNXRzlPVW1aaWJHTjZZa0VpIiwiZXhwIjpudWxsLCJwdXIiOiJjb29raWUuZ3Vlc3RfdG9rZW4ifX0%3D--5006ba5d346f621c760a29b6a797bf351d17d1b8; _sandbox_session=vhutu5%2FL9NmWrUpGc3DxrFA%2FFsQD1dHn1cNsD7nvE84zcjWf17Af4%2F%2F2Vab3md71b6KTb9NP6WktdXktpwH4eU01jEGIBXG5%2BMzW5nL0nb4W269qk1io4LYljvoOg8%2BZVll7oJCVkJLKKh0sSoS0Kg8j%2FCHHs%2BsShohP%2BGnA%2Bfr9Ub8H6HofpSmloSpsfHHygmX0ho03fEgzHJ4DD5wJctaNKwg7NhVikHh5kgIPPHl84OGCgv3p2oe9jR19HTxOKq7BtyvDd7XZsecWhkcfS8BPnvDDUWZG6qpAEFI5kWo81KkpSJ%2Bp6Q1HOo8%3D--n3G2vgaDG7VS%2B%2FhF--ZTjxBAkfGG3hpr4GRQ2S1Q%3D%3D; __profilin=p%3Dt" http://localhost:3000/orders/populate
- Reload your browser and look at how your cart got updated.
Patches
Please, upgrade solidus to versions 3.1.5, 3.0.5 or 2.11.14.
After upgrading, make sure you read the "Upgrade notes" section below.
Upgrade notes
The patch adds CSRF token verification to the "Add to cart" action. Adding forgery protection to a form that missed it can have some side effects.
InvalidAuthenticityToken errors
If you're using the :exception strategy, it's likely that after upgrading, you'll see more ActionController::InvalidAuthenticityToken errors popping out in your logs. Due to browser-side cache, a form can be re-rendered and sent without any attached request cookie (for instance, when re-opening a mobile browser). That will cause an authentication error, as the sent token won't match with the one in the session (none in this case). That's a known problem in the Rails community (see https://github.com/rails/rails/issues/21948), and, at this point, there's no perfect solution.
Any attempt to mitigate the issue should be seen at the application level. For an excellent survey of all the available options, take a look at https://github.com/betagouv/demarches-simplifiees.fr/blob/5b4f7f9ae9eaf0ac94008b62f7047e4714626cf9/doc/adr-csrf-forgery.md. The latter is a third-party link. As the information is relevant here, we're going to copy it below, but it should be clear that all the credit goes to @kemenaran:
Protecting against request forgery using CRSF tokens
Context
Rails has CSRF protection enabled by default, to protect against POST-based CSRF attacks.
To protect from this, Rails stores two copies of a random token (the so-named CSRF token) on each request: - one copy embedded in each HTML page, - another copy in the user session.
When performing a POST request, Rails checks that the two copies match – and otherwise denies the request. This protects against an attacker that would generate a form secretly pointing to our website: the attacker can't read the token in the session, and so can't post a form with a valid token.
The problem is that, much more often, this has false positives. There are several cases for that, including:
The web browser (often mobile) loads a page containing a form, then is closed by the user. Later, when the browser is re-opened, it restores the page from the cache. But the session cookie has expired, and so is not restored – so the copy of the CSRF token stored in the session is missing. When the user submits the form, they get an "InvalidAuthenticityToken" exception.
The user attempts to fill a form, and gets an error message (usually in response to a POST request). They close the browser. When the browser is re-opened, it attempts to restore the page. On Chrome this is blocked by the browser, because the browser denies retrying a (probably non-idempotent) POST request. Safari however happily retries the POST request – but without sending any cookies (in an attempt to avoid having unexpected side-effects). So the copy of the CSRF token in the session is missing (because no cookie was sent), and the user get an "InvalidAuthenticityToken" exception.
Options considered
Extend the session cookie duration
We can configure the session cookie to be valid for a longer time (like 2 weeks).
Pros: - It solves 1., because when the browser restores the page, the session cookie is still valid.
Cons: - Users would be signed-in for a much longer time by default, which has unacceptable security implications. - It doesn't solve 2. (because Safari doesn't send any cookie when restoring a page from a POST request)
Change the cache parameters
We can send a HTTP cache header stating 'Cache-Control: no-store, no-cache'. This instructs the browser to never keep any copy of the page, and to always make a request to the server to restore it.
This solution was attempted during a year in production, and solved 1. – but also introduced another type of InvalidAuthenticityToken errors. In that scenario, the user attempts to fill a form, and gets an error message (usually in response to a POST request). They then navigate on another domain (like France Connect), then hit the "Back" button. Crossing back the domain boundary may cause the browser to either block the request or retry an invalid POST request.
Pros: - It solves 1., because on relaunch the browser requests a fresh page again (instead of serving it from its cache), thus retrieving a fresh session and a fresh matching CSRF token.
Cons: - It doesn't solve 2. - It causes another type of InvalidAuthenticityToken errors.
Using a null-session strategy
We can change the default protect_from_forgery strategy to :null_session. This makes the current request use an empty session for the request duration.
Pros: - It kind of solves 1., by redirecting to a "Please sign-in" page when a stale form is submitted.
Cons: - The user is asked to sign-in only after filling and submitting the form, losing their time and data - The user will not be redirected to their original page after signing-in - It has potential security implications: as the (potentically malicious) request runs anyway, variables cached by a controller before the Null session is created may allow the form submission to succeed anyway (https://www.veracode.com/blog/managing-appsec/when-rails-protectfromforgery-fails)
Using a reset-session strategy
We can change the default protect_from_forgery strategy to :reset_session. This clears the user session permanently, logging them out until they log in again.
Pros: - It kind of solves 1., by redirecting to a "Please sign-in" page when a stale form is submitted.
Cons: - A forgery error in a browser tab will disconnect the user in all its open tabs - It has potential security implications: as the (potentically malicious) request runs anyway, variables cached by a controller before the Null session is created may allow the form submission to succeed anyway (https://www.veracode.com/blog/managing-appsec/when-rails-protectfromforgery-fails) - It allows an attacker to disconnect an user on demand, which is not only inconvenient, but also has security implication (the attacker could then log the user on it's own attacker account, pretending to be the user account)
Redirect to login form
When a forgery error occurs, we can instead redirect to the login form.
Pros: - It kind of solves 1., by redirecting to a "Please sign-in" page when a stale form is submitted (but the user data is lost). - It kind of solves 2., by redirecting to a "Please sign-in" page when a previously POSTed form is reloaded.
Cons: - Not all forms require authentication – so for public forms there is no point redirecting to the login form. - The user will not be redirected to their original page after signing-in (because setting the redirect path is a state-changing action, and it is dangerous to let an unauthorized request changing the state – an attacker could control the path where an user is automatically redirected to.) - The implementation is finicky, and may introduce security errors. For instance, a naive implementation that catches the exception and redirect_to the sign-in page will prevent Devise from running a cleanup code – which means the user will still be logged, and the CSRF protection is bypassed. However a well-tested implementation that lets Devise code run should avoid these pittfalls.
Using a long-lived cookie for CSRF tokens
Instead of storing the CSRF token in the session cookie (which is deleted when the browser is closed), we can instead store it in a longer-lived cookie. For this we need to patch Rails.
Pros: - It solves 1., because when the user submits a stale form, even if the session cookie because stale, the long-lived CSRF cookie is still valid.
Cons: - It doesn't solve 2., because when Safari retries a POST request, it sends none of the cookies (not even long-lived ones). - Patching Rails may introduce security issues (now or in the future)
Broken behavior due to session expiration + template cache
Although pretty unlikely, you should make sure that your current setup for cache/session expiration is compatible. The upgrade can break the addition of products to the cart if both:
-
The "Add to cart" form is being cached (usually along with the variant information).
-
A user session is reset at every or every few requests.
The token validation depends on the issuing and consuming sessions being the same. If a product page is cached with the token in it, it can become stale on a subsequent rendering if the session changes.
To check that you're safe, after having upgraded locally, go through the following steps:
- Enable cache on dev mode:
bash
bin/rails dev:cache
-
Visit the page for a variant with stock.
-
Reload that page several times.
-
Click on the "Add to cart" button.
-
Remember to rerun
bin/rails dev:cacheto turn off cache again.
No error or session reset should happen.
Otherwise, you can try with:
- Revisiting how your session gets expired.
- Changing the caching strategy to exclude the token.
Using weaker CSRF protection strategies
It's also important to understand that a complete fix will only be in place when using the :exception forgery protection strategy. The solidus_frontend engine can't do pretty much anything otherwise. Using weaker CSRF strategies should be an informed and limited decision made by the application team. After the upgrade:
-
An app using
:null_sessionshould also be safe, but there will be side effects. That strategy runs with a null object session. As such, no order and no user is found on it. A newcartstate order is created in the database, associated with no user. Next time the user visits the site, they won't find any difference in its cart state. -
An app using
:reset_sessionis not entirely safe. That strategy resets the session. That means that registered users will be logged out. Next time a user visits, they'll see the cart with the items added during the CSRF attack, although it won't be associated with their account in the case of registered users.
Reversing the update
If you still want to deploy the upgraded version before changing your application code (if the latter is needed), you can add the following workaround to your config/application.rb (however, take into account that you'll keep being vulnerable):
config.after_initialize do
Spree::OrdersController.skip_before_action :verify_authenticity_token, only: [:populate]
end
Workarounds
If an upgrade is not an option, you can work around the issue by adding the following to config/application.rb:
config.after_initialize do
Spree::OrdersController.protect_from_forgery with: ApplicationController.forgery_protection_strategy.name.demodulize.underscore.to_sym, only: [:populate]
end
However, go through the same safety check detailed on "Upgrade notes" above.
References
For more information
If you have any questions or comments about this advisory: * Open an issue or a discussion in Solidus. * Email us at security@solidus.io * Contact the core team on Slack
{
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "solidus_frontend"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.11.14"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "RubyGems",
"name": "solidus_frontend"
},
"ranges": [
{
"events": [
{
"introduced": "3.0.0"
},
{
"fixed": "3.0.5"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "RubyGems",
"name": "solidus_frontend"
},
"ranges": [
{
"events": [
{
"introduced": "3.1.0"
},
{
"fixed": "3.1.5"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-43846"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": true,
"github_reviewed_at": "2022-01-04T20:24:16Z",
"nvd_published_at": "2021-12-20T22:15:00Z",
"severity": "MODERATE"
},
"details": "### Impact\nCSRF vulnerability that allows a malicious site to add an item to the user\u0027s cart without their knowledge.\n\nAll `solidus_frontend` versions are affected. If you\u0027re using your own storefront, please, follow along to make sure you\u0027re not affected.\n\nTo reproduce the issue:\n\n- Pick the id for a variant with available stock. From the rails console:\n\n ```ruby\n Spree::Variant.in_stock.pluck(:id)\n ```\n\n Say we pick variant id `2`.\n\n- Launch your application, for instance, on `http://localhost:3000`:\n\n ```bash\n bin/rails server\n ```\n\n- Open your browser dev tools.\n\n- Click on whatever link in your store.\n\n- Copy the value of the `Cookie` request header sent for the previous request from your browser dev tools.\n\n- Execute the following, using your previously selected variant id and the value of the `Cookie` header (notice how it doesn\u0027t contain any authentication token):\n\n ```bash\n curl -X POST -d \"variant_id=2\u0026quantity=1\" -H \"Cookie: guest_token=eyJfcmFpbHMiOnsibWVzc2FnZSI6IklrWlRVMWRQWnpKMVZVdFNXRzlPVW1aaWJHTjZZa0VpIiwiZXhwIjpudWxsLCJwdXIiOiJjb29raWUuZ3Vlc3RfdG9rZW4ifX0%3D--5006ba5d346f621c760a29b6a797bf351d17d1b8; _sandbox_session=vhutu5%2FL9NmWrUpGc3DxrFA%2FFsQD1dHn1cNsD7nvE84zcjWf17Af4%2F%2F2Vab3md71b6KTb9NP6WktdXktpwH4eU01jEGIBXG5%2BMzW5nL0nb4W269qk1io4LYljvoOg8%2BZVll7oJCVkJLKKh0sSoS0Kg8j%2FCHHs%2BsShohP%2BGnA%2Bfr9Ub8H6HofpSmloSpsfHHygmX0ho03fEgzHJ4DD5wJctaNKwg7NhVikHh5kgIPPHl84OGCgv3p2oe9jR19HTxOKq7BtyvDd7XZsecWhkcfS8BPnvDDUWZG6qpAEFI5kWo81KkpSJ%2Bp6Q1HOo8%3D--n3G2vgaDG7VS%2B%2FhF--ZTjxBAkfGG3hpr4GRQ2S1Q%3D%3D; __profilin=p%3Dt\" http://localhost:3000/orders/populate\n ```\n\n- Reload your browser and look at how your cart got updated.\n\n### Patches\n\nPlease, upgrade `solidus` to versions `3.1.5`, `3.0.5` or `2.11.14`.\n\nAfter upgrading, make sure you read the \"Upgrade notes\" section below.\n\n### Upgrade notes\n\nThe patch adds CSRF token verification to the \"Add to cart\" action. Adding forgery protection to a form that missed it can have some side effects.\n\n#### `InvalidAuthenticityToken` errors\n\nIf you\u0027re using the `:exception` strategy, it\u0027s likely that after upgrading, you\u0027ll see more `ActionController::InvalidAuthenticityToken` errors popping out in your logs. Due to browser-side cache, a form can be re-rendered and sent without any attached request cookie (for instance, when re-opening a mobile browser). That will cause an authentication error, as the sent token won\u0027t match with the one in the session (none in this case). That\u0027s a known problem in the Rails community (see https://github.com/rails/rails/issues/21948), and, at this point, there\u0027s no perfect solution.\n\nAny attempt to mitigate the issue should be seen at the application level. For an excellent survey of all the available options, take a look at https://github.com/betagouv/demarches-simplifiees.fr/blob/5b4f7f9ae9eaf0ac94008b62f7047e4714626cf9/doc/adr-csrf-forgery.md. The latter is a third-party link. As the information is relevant here, we\u0027re going to copy it below, but it should be clear that all the credit goes to @kemenaran:\n\n\u003e # Protecting against request forgery using CRSF tokens\n\u003e \n\u003e ## Context\n\u003e \n\u003e Rails has CSRF protection enabled by default, to protect against POST-based CSRF attacks.\n\u003e \n\u003e To protect from this, Rails stores two copies of a random token (the so-named CSRF token) on each request:\n\u003e - one copy embedded in each HTML page,\n\u003e - another copy in the user session.\n\u003e \n\u003e When performing a POST request, Rails checks that the two copies match \u2013 and otherwise denies the request. This protects against an attacker that would generate a form secretly pointing to our website: the attacker can\u0027t read the token in the session, and so can\u0027t post a form with a valid token.\n\u003e \n\u003e The problem is that, much more often, this has false positives. There are several cases for that, including:\n\u003e \n\u003e 1. The web browser (often mobile) loads a page containing a form, then is closed by the user. Later, when the browser is re-opened, it restores the page from the cache. But the session cookie has expired, and so is not restored \u2013 so the copy of the CSRF token stored in the session is missing. When the user submits the form, they get an \"InvalidAuthenticityToken\" exception.\n\u003e \n\u003e 2. The user attempts to fill a form, and gets an error message (usually in response to a POST request). They close the browser. When the browser is re-opened, it attempts to restore the page. On Chrome this is blocked by the browser, because the browser denies retrying a (probably non-idempotent) POST request. Safari however happily retries the POST request \u2013 but without sending any cookies (in an attempt to avoid having unexpected side-effects). So the copy of the CSRF token in the session is missing (because no cookie was sent), and the user get an \"InvalidAuthenticityToken\" exception.\n\u003e \n\u003e ## Options considered\n\u003e \n\u003e ### Extend the session cookie duration\n\u003e \n\u003e We can configure the session cookie to be valid for a longer time (like 2 weeks).\n\u003e \n\u003e Pros:\n\u003e - It solves 1., because when the browser restores the page, the session cookie is still valid.\n\u003e \n\u003e Cons:\n\u003e - Users would be signed-in for a much longer time by default, which has unacceptable security implications.\n\u003e - It doesn\u0027t solve 2. (because Safari doesn\u0027t send any cookie when restoring a page from a POST request)\n\u003e \n\u003e ### Change the cache parameters\n\u003e \n\u003e We can send a HTTP cache header stating \u0027Cache-Control: no-store, no-cache\u0027. This instructs the browser to never keep any copy of the page, and to always make a request to the server to restore it.\n\u003e \n\u003e This solution was attempted during a year in production, and solved 1. \u2013 but also introduced another type of InvalidAuthenticityToken errors. In that scenario, the user attempts to fill a form, and gets an error message (usually in response to a POST request). They then navigate on another domain (like France Connect), then hit the \"Back\" button. Crossing back the domain boundary may cause the browser to either block the request or retry an invalid POST request.\n\u003e \n\u003e Pros:\n\u003e - It solves 1., because on relaunch the browser requests a fresh page again (instead of serving it from its cache), thus retrieving a fresh session and a fresh matching CSRF token.\n\u003e \n\u003e Cons:\n\u003e - It doesn\u0027t solve 2.\n\u003e - It causes another type of InvalidAuthenticityToken errors.\n\u003e \n\u003e ### Using a null-session strategy\n\u003e \n\u003e We can change the default protect_from_forgery strategy to :null_session. This makes the current request use an empty session for the request duration.\n\u003e \n\u003e Pros:\n\u003e - It kind of solves 1., by redirecting to a \"Please sign-in\" page when a stale form is submitted.\n\u003e \n\u003e Cons:\n\u003e - The user is asked to sign-in only after filling and submitting the form, losing their time and data\n\u003e - The user will not be redirected to their original page after signing-in\n\u003e - It has potential security implications: as the (potentically malicious) request runs anyway, variables cached by a controller before the Null session is created may allow the form submission to succeed anyway (https://www.veracode.com/blog/managing-appsec/when-rails-protectfromforgery-fails)\n\u003e \n\u003e ### Using a reset-session strategy\n\u003e \n\u003e We can change the default protect_from_forgery strategy to :reset_session. This clears the user session permanently, logging them out until they log in again.\n\u003e \n\u003e Pros: \n\u003e - It kind of solves 1., by redirecting to a \"Please sign-in\" page when a stale form is submitted.\n\u003e \n\u003e Cons:\n\u003e - A forgery error in a browser tab will disconnect the user in all its open tabs\n\u003e - It has potential security implications: as the (potentically malicious) request runs anyway, variables cached by a controller before the Null session is created may allow the form submission to succeed anyway (https://www.veracode.com/blog/managing-appsec/when-rails-protectfromforgery-fails)\n\u003e - It allows an attacker to disconnect an user on demand, which is not only inconvenient, but also has security implication (the attacker could then log the user on it\u0027s own attacker account, pretending to be the user account)\n\u003e \n\u003e ### Redirect to login form\n\u003e \n\u003e When a forgery error occurs, we can instead redirect to the login form.\n\u003e \n\u003e Pros:\n\u003e - It kind of solves 1., by redirecting to a \"Please sign-in\" page when a stale form is submitted (but the user data is lost).\n\u003e - It kind of solves 2., by redirecting to a \"Please sign-in\" page when a previously POSTed form is reloaded.\n\u003e \n\u003e Cons:\n\u003e - Not all forms require authentication \u2013 so for public forms there is no point redirecting to the login form. \n\u003e - The user will not be redirected to their original page after signing-in (because setting the redirect path is a state-changing action, and it is dangerous to let an unauthorized request changing the state \u2013 an attacker could control the path where an user is automatically redirected to.)\n\u003e - The implementation is finicky, and may introduce security errors. For instance, a naive implementation that catches the exception and redirect_to the sign-in page will prevent Devise from running a cleanup code \u2013 which means the user will still be logged, and the CSRF protection is bypassed. However a well-tested implementation that lets Devise code run should avoid these pittfalls.\n\u003e \n\u003e ### Using a long-lived cookie for CSRF tokens\n\u003e \n\u003e Instead of storing the CSRF token in the session cookie (which is deleted when the browser is closed), we can instead store it in a longer-lived cookie. For this we need to patch Rails.\n\u003e \n\u003e Pros:\n\u003e - It solves 1., because when the user submits a stale form, even if the session cookie because stale, the long-lived CSRF cookie is still valid.\n\u003e \n\u003e Cons:\n\u003e - It doesn\u0027t solve 2., because when Safari retries a POST request, it sends none of the cookies (not even long-lived ones).\n\u003e - Patching Rails may introduce security issues (now or in the future)\n\n#### Broken behavior due to session expiration + template cache\n\nAlthough pretty unlikely, you should make sure that your current setup for cache/session expiration is compatible. The upgrade can break the addition of products to the cart if both:\n\n- The \"Add to cart\" form is being cached (usually along with the variant information).\n\n- A user session is reset at every or every few requests.\n\nThe token validation depends on the issuing and consuming sessions being the same. If a product page is cached with the token in it, it can become stale on a subsequent rendering if the session changes.\n\nTo check that you\u0027re safe, after having upgraded locally, go through the following steps:\n\n- Enable cache on dev mode:\n\n ```bash\n bin/rails dev:cache\n ```\n\n- Visit the page for a variant with stock.\n\n- Reload that page several times.\n\n- Click on the \"Add to cart\" button.\n\n- Remember to rerun `bin/rails dev:cache` to turn off cache again.\n\nNo error or session reset should happen.\n\nOtherwise, you can try with:\n\n- Revisiting how your session gets expired.\n- Changing the caching strategy to exclude the token.\n\n#### Using weaker CSRF protection strategies\n\nIt\u0027s also important to understand that a complete fix will only be in place when using the `:exception` forgery protection strategy. The `solidus_frontend` engine can\u0027t do pretty much anything otherwise. Using weaker CSRF strategies should be an informed and limited decision made by the application team. After the upgrade:\n\n- An app using `:null_session` should also be safe, but there will be side effects. That strategy runs with a null object session. As such, no order and no user is found on it. A new `cart` state order is created in the database, associated with no user. Next time the user visits the site, they won\u0027t find any difference in its cart state.\n\n- An app using `:reset_session` is not entirely safe. That strategy resets the session. That means that registered users will be logged out. Next time a user visits, they\u0027ll see the cart with the items added during the CSRF attack, although it won\u0027t be associated with their account in the case of registered users.\n\n#### Reversing the update\n\nIf you still want to deploy the upgraded version before changing your application code (if the latter is needed), you can add the following workaround to your `config/application.rb` (however, take into account that you\u0027ll keep being vulnerable):\n\n```ruby\nconfig.after_initialize do\n Spree::OrdersController.skip_before_action :verify_authenticity_token, only: [:populate]\nend\n```\n\n### Workarounds\n\nIf an upgrade is not an option, you can work around the issue by adding the following to `config/application.rb`:\n\n```ruby\nconfig.after_initialize do\n Spree::OrdersController.protect_from_forgery with: ApplicationController.forgery_protection_strategy.name.demodulize.underscore.to_sym, only: [:populate]\nend\n```\n\nHowever, go through the same safety check detailed on \"Upgrade notes\" above.\n\n### References\n\n- [CSRF on the Rails guides](https://guides.rubyonrails.org/security.html#cross-site-request-forgery-csrf)\n- [How CSRF tokens are generated and validated on Rails](https://medium.com/rubyinside/a-deep-dive-into-csrf-protection-in-rails-19fa0a42c0ef)\n- [Solidus security](https://solidus.io/security/)\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an [issue](https://github.com/solidusio/solidus/issues) or a [discussion](https://github.com/solidusio/solidus/discussions) in Solidus.\n* Email us at [security@solidus.io](mailto:security@soliidus.io)\n* Contact the core team on [Slack](http://slack.solidus.io/)\n",
"id": "GHSA-h3fg-h5v3-vf8m",
"modified": "2023-05-04T19:59:15Z",
"published": "2022-01-06T18:33:44Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/solidusio/solidus/security/advisories/GHSA-h3fg-h5v3-vf8m"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-43846"
},
{
"type": "WEB",
"url": "https://github.com/solidusio/solidus/commit/4d17cacf066d9492fc04eb3a0b16084b47376d81"
},
{
"type": "WEB",
"url": "https://github.com/solidusio/solidus/commit/a1b9bf7f24f9b8684fc4d943eacb02b1926c77c6"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/solidus_frontend/CVE-2021-43846.yml"
},
{
"type": "PACKAGE",
"url": "https://github.com/solidusio/solidus"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "CSRF forgery protection bypass in solidus_frontend"
}
GHSA-H3FR-83X2-RWVV
Vulnerability from github – Published: 2024-12-16 15:31 – Updated: 2026-04-01 18:32Cross-Site Request Forgery (CSRF) vulnerability in Mansur Ahamed Ui Slider Filter By Price allows Cross Site Request Forgery.This issue affects Ui Slider Filter By Price: from n/a through 1.1.
{
"affected": [],
"aliases": [
"CVE-2024-54419"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-12-16T15:15:19Z",
"severity": "MODERATE"
},
"details": "Cross-Site Request Forgery (CSRF) vulnerability in Mansur Ahamed Ui Slider Filter By Price allows Cross Site Request Forgery.This issue affects Ui Slider Filter By Price: from n/a through 1.1.",
"id": "GHSA-h3fr-83x2-rwvv",
"modified": "2026-04-01T18:32:50Z",
"published": "2024-12-16T15:31:36Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-54419"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/ui-slider-filter-by-price/vulnerability/wordpress-ui-slider-filter-by-price-plugin-1-1-cross-site-request-forgery-csrf-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-H3Q5-GJCC-WRM3
Vulnerability from github – Published: 2024-07-03 18:48 – Updated: 2024-07-03 18:48The WPQA Builder WordPress plugin before 6.1.1 does not have CSRF checks in some places, which could allow attackers to make logged in users perform unwanted actions via CSRF attacks
{
"affected": [],
"aliases": [
"CVE-2024-2376"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-07-03T06:15:03Z",
"severity": "HIGH"
},
"details": "The WPQA Builder WordPress plugin before 6.1.1 does not have CSRF checks in some places, which could allow attackers to make logged in users perform unwanted actions via CSRF attacks",
"id": "GHSA-h3q5-gjcc-wrm3",
"modified": "2024-07-03T18:48:03Z",
"published": "2024-07-03T18:48:03Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-2376"
},
{
"type": "WEB",
"url": "https://wpscan.com/vulnerability/bdd2e323-d589-4050-bc27-5edd2507a818"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-H3V8-M8W2-RQJJ
Vulnerability from github – Published: 2022-03-31 00:00 – Updated: 2022-04-06 00:01A Cross-Site Request Forgery (CSRF) in Pluck CMS v4.7.15 allows attackers to change the password of any given user by exploiting this feature leading to account takeover.
{
"affected": [],
"aliases": [
"CVE-2022-27432"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-03-30T00:15:00Z",
"severity": "HIGH"
},
"details": "A Cross-Site Request Forgery (CSRF) in Pluck CMS v4.7.15 allows attackers to change the password of any given user by exploiting this feature leading to account takeover.",
"id": "GHSA-h3v8-m8w2-rqjj",
"modified": "2022-04-06T00:01:57Z",
"published": "2022-03-31T00:00:24Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-27432"
},
{
"type": "WEB",
"url": "https://owasp.org/www-community/attacks/csrf"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/50831"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-H3VX-8RV6-2H7X
Vulnerability from github – Published: 2022-10-13 19:00 – Updated: 2022-10-14 19:00WAYOS LQ_09 22.03.17V was discovered to contain a Cross-Site Request Forgery (CSRF) which allows attackers to send crafted requests to the server from the affected device. This vulnerability is exploitable due to a lack of authentication in the component Usb_upload.htm.
{
"affected": [],
"aliases": [
"CVE-2022-41489"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-10-13T14:15:00Z",
"severity": "HIGH"
},
"details": "WAYOS LQ_09 22.03.17V was discovered to contain a Cross-Site Request Forgery (CSRF) which allows attackers to send crafted requests to the server from the affected device. This vulnerability is exploitable due to a lack of authentication in the component Usb_upload.htm.",
"id": "GHSA-h3vx-8rv6-2h7x",
"modified": "2022-10-14T19:00:41Z",
"published": "2022-10-13T19:00:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-41489"
},
{
"type": "WEB",
"url": "https://github.com/splashsc/IOT_Vulnerability_Discovery/blob/main/wayos/wayos_LQ-09%2022_enterprise-class/3_csrf.md"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-H43F-4WGW-VFX3
Vulnerability from github – Published: 2024-02-27 12:31 – Updated: 2024-02-27 12:31The Categorify plugin for WordPress is vulnerable to Cross-Site Request Forgery in all versions up to, and including, 1.0.7.4. This is due to missing or incorrect nonce validation on the categorifyAjaxRenameCategory function. This makes it possible for unauthenticated attackers to rename categories via a forged request granted they can trick a site administrator into performing an action such as clicking on a link.
{
"affected": [],
"aliases": [
"CVE-2024-1909"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-02-27T11:15:09Z",
"severity": "MODERATE"
},
"details": "The Categorify plugin for WordPress is vulnerable to Cross-Site Request Forgery in all versions up to, and including, 1.0.7.4. This is due to missing or incorrect nonce validation on the categorifyAjaxRenameCategory function. This makes it possible for unauthenticated attackers to rename categories via a forged request granted they can trick a site administrator into performing an action such as clicking on a link.",
"id": "GHSA-h43f-4wgw-vfx3",
"modified": "2024-02-27T12:31:11Z",
"published": "2024-02-27T12:31:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-1909"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/changeset/3034410/categorify"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/58b29729-e9c3-4d57-affd-6142dfa8cc6f?source=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-H44C-M38R-J8W7
Vulnerability from github – Published: 2025-05-16 18:31 – Updated: 2025-05-16 18:31Cross-Site Request Forgery (CSRF) vulnerability in Shayan Farhang Pazhooh ShayanWeb Admin FontChanger allows Stored XSS. This issue affects ShayanWeb Admin FontChanger: from n/a through 1.8.1.
{
"affected": [],
"aliases": [
"CVE-2025-48114"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-05-16T16:15:43Z",
"severity": "HIGH"
},
"details": "Cross-Site Request Forgery (CSRF) vulnerability in Shayan Farhang Pazhooh ShayanWeb Admin FontChanger allows Stored XSS. This issue affects ShayanWeb Admin FontChanger: from n/a through 1.8.1.",
"id": "GHSA-h44c-m38r-j8w7",
"modified": "2025-05-16T18:31:09Z",
"published": "2025-05-16T18:31:09Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-48114"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/shayanweb-admin-fontchanger/vulnerability/wordpress-shayanweb-admin-fontchanger-plugin-1-8-1-cross-site-request-forgery-csrf-to-stored-xss-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L",
"type": "CVSS_V3"
}
]
}
Mitigation MIT-4
Strategy: Libraries or Frameworks
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
- For example, use anti-CSRF packages such as the OWASP CSRFGuard. [REF-330]
- Another example is the ESAPI Session Management control, which includes a component for CSRF. [REF-45]
Mitigation
Ensure that the application is free of cross-site scripting issues (CWE-79), because most CSRF defenses can be bypassed using attacker-controlled script.
Mitigation
Generate a unique nonce for each form, place the nonce into the form, and verify the nonce upon receipt of the form. Be sure that the nonce is not predictable (CWE-330). [REF-332]
Mitigation
Identify especially dangerous operations. When the user performs a dangerous operation, send a separate confirmation request to ensure that the user intended to perform that operation.
Mitigation
- Use the "double-submitted cookie" method as described by Felten and Zeller:
- When a user visits a site, the site should generate a pseudorandom value and set it as a cookie on the user's machine. The site should require every form submission to include this value as a form value and also as a cookie value. When a POST request is sent to the site, the request should only be considered valid if the form value and the cookie value are the same.
- Because of the same-origin policy, an attacker cannot read or modify the value stored in the cookie. To successfully submit a form on behalf of the user, the attacker would have to correctly guess the pseudorandom value. If the pseudorandom value is cryptographically strong, this will be prohibitively difficult.
- This technique requires Javascript, so it may not work for browsers that have Javascript disabled. [REF-331]
Mitigation
Do not use the GET method for any request that triggers a state change.
Mitigation
Check the HTTP Referer header to see if the request originated from an expected page. This could break legitimate functionality, because users or proxies may have disabled sending the Referer for privacy reasons.
CAPEC-111: JSON Hijacking (aka JavaScript Hijacking)
An attacker targets a system that uses JavaScript Object Notation (JSON) as a transport mechanism between the client and the server (common in Web 2.0 systems using AJAX) to steal possibly confidential information transmitted from the server back to the client inside the JSON object by taking advantage of the loophole in the browser's Same Origin Policy that does not prohibit JavaScript from one website to be included and executed in the context of another website.
CAPEC-462: Cross-Domain Search Timing
An attacker initiates cross domain HTTP / GET requests and times the server responses. The timing of these responses may leak important information on what is happening on the server. Browser's same origin policy prevents the attacker from directly reading the server responses (in the absence of any other weaknesses), but does not prevent the attacker from timing the responses to requests that the attacker issued cross domain.
CAPEC-467: Cross Site Identification
An attacker harvests identifying information about a victim via an active session that the victim's browser has with a social networking site. A victim may have the social networking site open in one tab or perhaps is simply using the "remember me" feature to keep their session with the social networking site active. An attacker induces a payload to execute in the victim's browser that transparently to the victim initiates a request to the social networking site (e.g., via available social network site APIs) to retrieve identifying information about a victim. While some of this information may be public, the attacker is able to harvest this information in context and may use it for further attacks on the user (e.g., spear phishing).
CAPEC-62: Cross Site Request Forgery
An attacker crafts malicious web links and distributes them (via web pages, email, etc.), typically in a targeted manner, hoping to induce users to click on the link and execute the malicious action against some third-party application. If successful, the action embedded in the malicious link will be processed and accepted by the targeted application with the users' privilege level. This type of attack leverages the persistence and implicit trust placed in user session cookies by many web applications today. In such an architecture, once the user authenticates to an application and a session cookie is created on the user's system, all following transactions for that session are authenticated using that cookie including potential actions initiated by an attacker and simply "riding" the existing session cookie.