CVE-2022-35943
SameSite may allow cross-site request forgery (CSRF) protection to be bypassed
Shield is an authentication and authorization framework for CodeIgniter 4. This vulnerability may allow SameSite Attackers to bypass the CodeIgniter4 CSRF protection 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)
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
5.9
SameSite may allow cross-site request forgery (CSRF) protection to be bypassed
Shield is an authentication and authorization framework for CodeIgniter 4. This vulnerability may allow SameSite Attackers to bypass the CodeIgniter4 CSRF protection 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)
- Record
CVE-2022-35943- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L - Weakness
- CWE-352
- Updated
- 2026-11-02
EUVDEUVD-2022-6486
5.9
Shield is an authentication and authorization framework for CodeIgniter 4. This vulnerability may allow SameSite Attackers to bypass the CodeIgniter4 CSRF protection 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)
- Record
EUVD-2022-6486- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-5hm8-vh6r-2cjq
5.9
CodeIgniter Shield Vulnerable to SameSite Attackers Bypassing the CSRF Protection
Impact
This vulnerability may allow SameSite Attackers to bypass the CodeIgniter4 CSRF protection 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/).
This vulnerability exists whether Config\Security::$csrfProtection is 'cookie' or 'session'.
It is also exploitable whether Config\Security::$regenerate is true or false.
Patches
Upgrade to CodeIgniter v4.2.3 or later and Shield v1.0.0-beta.2 or later.
Workarounds
Do all of the following:
- set
Config\Security::$csrfProtectionto'session' - remove old session data right after login (immediately after ID and password match)
- regenerate CSRF token right after login (immediately after ID and password match)
References
For more information
If you have any questions or comments about this advisory:
- Open an issue or discussion in codeigniter4/shield
- Email us at [email protected]
- Record
GHSA-5hm8-vh6r-2cjq- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L - Weakness
- CWE-352
- Updated
- 2026-11-02
NVD
5.9
Shield is an authentication and authorization framework for CodeIgniter 4. This vulnerability may allow SameSite Attackers to bypass the CodeIgniter4 CSRF protection 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)
- Record
CVE-2022-35943- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L - CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-352
- Updated
- 2026-11-02
OSV
5.9
SameSite may allow cross-site request forgery (CSRF) protection to be bypassed
Shield is an authentication and authorization framework for CodeIgniter 4. This vulnerability may allow SameSite Attackers to bypass the CodeIgniter4 CSRF protection 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)
- Record
CVE-2022-35943- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L - Weakness
- CWE-352
- Updated
- 2026-11-02
OSVGHSA-5hm8-vh6r-2cjq
5.9
CodeIgniter Shield Vulnerable to SameSite Attackers Bypassing the CSRF Protection
Impact
This vulnerability may allow SameSite Attackers to bypass the CodeIgniter4 CSRF protection 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/).
This vulnerability exists whether Config\Security::$csrfProtection is 'cookie' or 'session'.
It is also exploitable whether Config\Security::$regenerate is true or false.
Patches
Upgrade to CodeIgniter v4.2.3 or later and Shield v1.0.0-beta.2 or later.
Workarounds
Do all of the following:
- set
Config\Security::$csrfProtectionto'session' - remove old session data right after login (immediately after ID and password match)
- regenerate CSRF token right after login (immediately after ID and password match)
References
For more information
If you have any questions or comments about this advisory:
- Open an issue or discussion in codeigniter4/shield
- Email us at [email protected]
- Record
GHSA-5hm8-vh6r-2cjq- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L - Weakness
- CWE-352
- Updated
- 2026-11-02
OSVBIT-codeigniter-2022-35943 No score
Shield is an authentication and authorization framework for CodeIgniter 4. This vulnerability may allow SameSite Attackers to bypass the CodeIgniter4 CSRF protection 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)
- Record
BIT-codeigniter-2022-35943- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
codeigniter4/shieldPackagist |
1.0.0-beta to 1.0.0-beta | 1.0.0-beta.2 |
codeigniterBitnami |
before 4.2.3 | 4.2.3 |
codeigniter4/shieldPackagist |
1.0.0-beta up to 1.0.0-beta.2, plus listed versions v1.0.0-beta |
1.0.0-beta.2 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-35943 is a medium vulnerability (CVSS 5.9) in Codeigniter, published August 12, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.61%, the 49th percentile. Fixed in codeigniter4/shield 1.0.0-beta.2.
References
github.com/codeigniter4/shield/security/advisories/GHSA-5hm8-vh6r-2cjq
codeigniter4.github.io/userguide/libraries/security.htm
developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
jub0bs.com/posts/2021-01-29-great-samesite-confusion
nvd.nist.gov/vuln/detail/CVE-2022-35943
github.com/codeigniter4/shield/commit/342a368536678621998c3c41d276480cd14ec6c6
github.com/advisories/GHSA-5hm8-vh6r-2cjq
github.com/CVEProject/cvelistV5/tree/main/cves/2022/35xxx/CVE-2022-35943.json
github.com/codeigniter4/shield