CVE-2022-35943
What it is
Shield is an authentication and authorization framework for CodeIgniter 4. This vulnerability may allow [SameSite Attackers](https://canitakeyoursubdomain.name/) to bypass the [CodeIgniter4 CSRF protection](https://codeigniter4.github.io/userguide/libraries/security.html) mechanism with CodeIgniter Shield. For this attack to succeed, the attacker must have direct (or indirect, e.g., XSS) control over a subdomain site (e.g., `https://a.example.com/`) of the target site (e.g., `http://example.com/`). Upgrade to **CodeIgniter v4.2.3 or later** and **Shield v1.0.0-beta.2 or later**. As a workaround: set `Config\Security::$csrfProtection` to `'session,'`remove old session data right after login (immediately after ID and password match) and regenerate CSRF token right after login (immediately after ID and password match)
At a glance
- Exploitability
- Can be exploited over the network without logging in, but needs a user to act. High risk of data tampering.
- Exploit odds
- 0.6% chance of exploitation in the next 30 days (EPSS).
- Fix
- A patch, advisory or fixed version is referenced. Upgrade or apply it.
Timeline
- PublishedDisclosed publicly on CVE.org and NVD
- Last updatedMost recent change to the record
Why it ranks here
- Exploited in the wild: no, CISA does not list it.
- Exploit odds: 0.6% in the next 30 days (EPSS).
- Severity: 5.9 MEDIUM (CVSS).
- Fix: a patch or advisory is linked.
Details
- Published
- Last modified
- Exploit probability
- 0.6% · EPSS, next 30 days
- Weakness
- CWE-352 · Cross-site request forgery
- Record status
- Modified
Affected
- Codeigniter < 4.2.3
- Codeigniter Shield 1.0.0
Attack profile CVSS 3.1 · 5.9
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- High
- Availability
- Low
Raw vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L
Is it in your code?
Hand this to your coding agent. It searches your project for the affected products and checks versions. Nothing leaves your machine.
Read https://cve-list.com/agent/cve/CVE-2022-35943.md and follow it. Check whether this project is affected by CVE-2022-35943. Read only. Don't change anything and don't upload my code. Tell me yes, no or not sure, with the file as proof.
Fix and advisories
- https://github.com/codeigniter4/shield/security/advisories/GHSA-5hm8-vh6r-2cjq
- https://github.com/codeigniter4/shield/security/advisories/GHSA-5hm8-vh6r-2cjq
References
- https://codeigniter4.github.io/userguide/libraries/security.htm
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
- https://github.com/codeigniter4/shield/security/advisories/GHSA-5hm8-vh6r-2cjq
- https://jub0bs.com/posts/2021-01-29-great-samesite-confusion
- https://codeigniter4.github.io/userguide/libraries/security.htm
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
- https://github.com/codeigniter4/shield/security/advisories/GHSA-5hm8-vh6r-2cjq
- https://jub0bs.com/posts/2021-01-29-great-samesite-confusion