Every CVE Search/ Get API key

CVE-2022-35943

SameSite may allow cross-site request forgery (CSRF) protection to be bypassed

5.9 MediumFix available

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

0.61%Down 0.3 points since Aug 13, 2022
90%50%10%1%

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 MediumCVSS: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 MediumCVSS: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::$csrfProtection to '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:

Record
GHSA-5hm8-vh6r-2cjq
CVSS 3.1
5.9 MediumCVSS: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 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L
CVSS 3.1
8.8 HighCVSS: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 MediumCVSS: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::$csrfProtection to '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:

Record
GHSA-5hm8-vh6r-2cjq
CVSS 3.1
5.9 MediumCVSS: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

Affected packages
PackageAffectedFixed
codeigniter4/shield
Packagist
1.0.0-beta to 1.0.0-beta
1.0.0-beta.2
codeigniter
Bitnami
before 4.2.3
4.2.3
codeigniter4/shield
Packagist
1.0.0-beta up to 1.0.0-beta.2, plus listed versions
v1.0.0-beta
1.0.0-beta.2

History

History
RecordedChangedSources
first indexedCVE 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

MoveEnter Open