ghsa-5hm8-vh6r-2cjq
Vulnerability from github
Published
2022-08-18 19:03
Modified
2022-08-18 19:03
Summary
CodeIgniter Shield Vulnerable to SameSite Attackers Bypassing the CSRF Protection
Details

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: * Open an issue or discussion in codeigniter4/shield * Email us at security@codeigniter.com

Show details on source website


{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "codeigniter4/shield"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.0.0-beta"
            },
            {
              "fixed": "1.0.0-beta.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "1.0.0-beta"
      ]
    }
  ],
  "aliases": [
    "CVE-2022-35943"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-352"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2022-08-18T19:03:34Z",
    "nvd_published_at": "2022-08-12T21:15:00Z",
    "severity": "MODERATE"
  },
  "details": "### Impact\nThis 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.\n\nFor 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/`).\n\nThis vulnerability exists whether `Config\\Security::$csrfProtection` is `\u0027cookie\u0027` or `\u0027session\u0027`.\nIt is also exploitable whether `Config\\Security::$regenerate` is `true` or `false`.\n\n### Patches\nUpgrade to **CodeIgniter v4.2.3 or later** and **Shield v1.0.0-beta.2 or later**.\n\n### Workarounds\nDo all of the following:\n- set `Config\\Security::$csrfProtection` to `\u0027session\u0027`\n- remove old session data right after login (immediately after ID and password match)\n- regenerate CSRF token right after login (immediately after ID and password match)\n\n### References\n- [CodeIgniter4 CSRF Protection](https://codeigniter4.github.io/userguide/libraries/security.html)\n- [SameSite Attacks](https://canitakeyoursubdomain.name/)\n- [SameSite Cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite)\n- [The great SameSite confusion](https://jub0bs.com/posts/2021-01-29-great-samesite-confusion/)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue or discussion in [codeigniter4/shield](https://github.com/codeigniter4/shield)\n* Email us at [security@codeigniter.com](mailto:security@codeigniter.com)\n",
  "id": "GHSA-5hm8-vh6r-2cjq",
  "modified": "2022-08-18T19:03:34Z",
  "published": "2022-08-18T19:03:34Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/codeigniter4/shield/security/advisories/GHSA-5hm8-vh6r-2cjq"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-35943"
    },
    {
      "type": "WEB",
      "url": "https://github.com/codeigniter4/shield/commit/342a368536678621998c3c41d276480cd14ec6c6"
    },
    {
      "type": "WEB",
      "url": "https://codeigniter4.github.io/userguide/libraries/security.htm"
    },
    {
      "type": "WEB",
      "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/codeigniter4/shield"
    },
    {
      "type": "WEB",
      "url": "https://jub0bs.com/posts/2021-01-29-great-samesite-confusion"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "CodeIgniter Shield Vulnerable to SameSite Attackers Bypassing the CSRF Protection"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…