CVE-2021-21424: Symfony/security Prevent User Enumeration Using Guard Vulnerability

MODERATE
Advisory Identifier: GHSA-5pv8-ppvj-4h68
CVSS 5.3
CWE-203 CWE-200
Published
Advisory Summary

CVE-2021-21424 is a MODERATE (CVSS 5.3) prevent user enumeration using guard vulnerability (CWE-203: Observable Discrepancy) affecting Symfony/security libraries in the Packagist ecosystem. The issue involves prevent user enumeration using guard or the new authenticator-based security. Remediation is available by upgrading affected packages to version 5.2.8, 3.4.48, 4.4.23, 2.10.7, 2.11.3, 1.29.2, 1.31.1, 3.4.49, 4.4.24, 5.2.9.

CVE-2021-21424 at a Glance

CVE Identifier CVE-2021-21424
GHSA Identifier GHSA-5pv8-ppvj-4h68
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-203: Observable Discrepancy
Affected Product Symfony/security
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-21424

To remediate this vulnerability, upgrade all affected Symfony/security dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

symfony/security fixed: 5.2.8
Upgrade symfony/security to 5.2.8
symfony/security-guard fixed: 3.4.48
Upgrade symfony/security-guard to 3.4.48
symfony/security-guard fixed: 4.4.23
Upgrade symfony/security-guard to 4.4.23
symfony/security-guard fixed: 5.2.8
Upgrade symfony/security-guard to 5.2.8
symfony/security-core fixed: 3.4.48
Upgrade symfony/security-core to 3.4.48
symfony/security-core fixed: 4.4.23
Upgrade symfony/security-core to 4.4.23
symfony/security-core fixed: 5.2.8
Upgrade symfony/security-core to 5.2.8
lexik/jwt-authentication-bundle fixed: 2.10.7
Upgrade lexik/jwt-authentication-bundle to 2.10.7
lexik/jwt-authentication-bundle fixed: 2.11.3
Upgrade lexik/jwt-authentication-bundle to 2.11.3
symfony/maker-bundle fixed: 1.29.2
Upgrade symfony/maker-bundle to 1.29.2
symfony/maker-bundle fixed: 1.31.1
Upgrade symfony/maker-bundle to 1.31.1
symfony/security-http fixed: 5.2.8
Upgrade symfony/security-http to 5.2.8
symfony/security fixed: 3.4.49
Upgrade symfony/security to 3.4.49
symfony/security fixed: 4.4.24
Upgrade symfony/security to 4.4.24
symfony/symfony fixed: 3.4.49
Upgrade symfony/symfony to 3.4.49
symfony/symfony fixed: 4.4.24
Upgrade symfony/symfony to 4.4.24
symfony/symfony fixed: 5.2.9
Upgrade symfony/symfony to 5.2.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for symfony/security

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-21424, inspect your project dependencies for Symfony/security:

inspect dependencies for symfony/security

Analyze the terminal output to locate any version of Symfony/security in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.2.8), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-203: Observable Discrepancy, where the product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor. In Symfony/security, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Description ----------- The ability to enumerate users was possible without relevant permissions due to different exception messages depending on whether the user existed or not. It was also possible to enumerate users by using a timing attack, by comparing time elapsed when authenticating an existing user and authenticating a non-existing user. Resolution ---------- We now ensure that 403s are returned whether the user exists or not if the password is invalid or if the user does not exist. The patch for this issue is available [here](https://github.com/symfony/symfony/commit/2a581d22cc621b33d5464ed65c4bc2057f72f011) for branch 3.4. Credits ------- I would like to thank James Isaac and Mathias Brodala for reporting the issue and Robin Chalas for fixing the issue.

CVE-2021-21424 Affected Symfony/security Versions

17 component(s)
Fixed Versions:
5.2.83.4.484.4.232.10.72.11.31.29.21.31.13.4.494.4.245.2.9
Product / Package Ecosystem Affected Versions Fixed Version
symfony/security
Packagist
≥ 5.0.0
< 5.2.8
5.2.8
symfony/security-guard
Packagist
≥ 2.8.0
< 3.4.48
3.4.48
symfony/security-guard
Packagist
≥ 4.0.0
< 4.4.23
4.4.23
symfony/security-guard
Packagist
≥ 5.0.0
< 5.2.8
5.2.8
symfony/security-core
Packagist
≥ 2.8.0
< 3.4.48
3.4.48
symfony/security-core
Packagist
≥ 4.0.0
< 4.4.23
4.4.23
symfony/security-core
Packagist
≥ 5.0.0
< 5.2.8
5.2.8
lexik/jwt-authentication-bundle
Packagist
≥ 2.0.0
< 2.10.7
2.10.7
lexik/jwt-authentication-bundle
Packagist
≥ 2.11.0
< 2.11.3
2.11.3
symfony/maker-bundle
Packagist
≥ 1.27.0
< 1.29.2
1.29.2
symfony/maker-bundle
Packagist
≥ 1.30.0
< 1.31.1
1.31.1
symfony/security-http
Packagist
≥ 5.1.0
< 5.2.8
5.2.8
symfony/security
Packagist
≥ 2.8.0
< 3.4.49
3.4.49
symfony/security
Packagist
≥ 4.0.0
< 4.4.24
4.4.24
symfony/symfony
Packagist
≥ 2.8.0
< 3.4.49
3.4.49
symfony/symfony
Packagist
≥ 4.0.0
< 4.4.24
4.4.24
symfony/symfony
Packagist
≥ 5.0.0
< 5.2.9
5.2.9

References

GitHub Advisory / Wiki ADVISORY
https://github.com/symfony/symfony/security/advisories/GHSA-5pv8-ppvj-4h68
NVD — CVE-2021-21424 NVD
https://nvd.nist.gov/vuln/detail/CVE-2021-21424
Security Fix Commit FIX COMMIT
https://github.com/symfony/symfony/commit/2a581d22cc621b33d5464ed65c4bc2057f72f011
symfony.com/cve-2021-21424 WEB
https://symfony.com/cve-2021-21424
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VRUS2H2SSOQWNLBD35SKIWIDQEMV2PD3
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UC7BND775DVZDQT3RMGD2HVB2PKLJDJW
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RH7TMM5CHQYBFFGXWRPJDPB3SKCZXI2M
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KENRNLB3FYXYGDWRBH2PDBOZZKOD7VY4
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VRUS2H2SSOQWNLBD35SKIWIDQEMV2PD3
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UC7BND775DVZDQT3RMGD2HVB2PKLJDJW
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RH7TMM5CHQYBFFGXWRPJDPB3SKCZXI2M
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KENRNLB3FYXYGDWRBH2PDBOZZKOD7VY4
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2023/07/msg00014.html
Symfony/security Source Repository REPOSITORY
https://github.com/symfony/symfony
Symfony/security Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2021-21424.yaml
Symfony/security Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/security/CVE-2021-21424.yaml
Symfony/security Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/security-http/CVE-2021-21424.yaml
Symfony/security Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/security-guard/CVE-2021-21424.yaml
Symfony/security Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/maker-bundle/CVE-2021-21424.yaml
Symfony/security Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/lexik/jwt-authentication-bundle/CVE-2021-21424.yaml

Frequently Asked Questions

What is CVE-2021-21424?
CVE-2021-21424 is a security vulnerability in Symfony/security involving Prevent user enumeration using Guard or the new Authenticator-based Security under CWE-203: Observable Discrepancy.
Which Symfony/security versions are affected?
Affected versions include releases prior to 5.2.8, 3.4.48, 4.4.23, 2.10.7, 2.11.3, 1.29.2, 1.31.1, 3.4.49, 4.4.24, 5.2.9 across affected packages: symfony/security, symfony/security-guard, symfony/security-core, lexik/jwt-authentication-bundle, symfony/maker-bundle, symfony/security-http, symfony/symfony.
What version fixes CVE-2021-21424?
Upgrading to 5.2.8, 3.4.48, 4.4.23, 2.10.7, 2.11.3, 1.29.2, 1.31.1, 3.4.49, 4.4.24, 5.2.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/security affected?
Yes, symfony/security is affected in releases prior to 5.2.8, 3.4.49, 4.4.24. Upgrade your dependency to 5.2.8, 3.4.49, 4.4.24 or later.
Is symfony/security-guard affected?
Yes, symfony/security-guard is affected in releases prior to 3.4.48, 4.4.23, 5.2.8. Upgrade your dependency to 3.4.48, 4.4.23, 5.2.8 or later.
What is the CVSS score of CVE-2021-21424?
CVE-2021-21424 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2021-21424?
CVE-2021-21424 is classified under CWE-203: Observable Discrepancy (The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor.).
How can I check Packagist dependencies for CVE-2021-21424?
Run the dependency tree command: 'inspect dependencies for symfony/security'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5pv8-ppvj-4h68",
  "modified" : "2024-02-26T12:39:59Z",
  "published" : "2021-05-13T20:23:02Z",
  "aliases" : [ "CVE-2021-21424" ],
  "summary" : "Prevent user enumeration using Guard or the new Authenticator-based Security",
  "details" : "Description\n-----------\n\nThe ability to enumerate users was possible without relevant permissions due to different exception messages depending on whether the user existed or not. It was also possible to enumerate users by using a timing attack, by comparing time elapsed when authenticating an existing user and authenticating a non-existing user.\n\nResolution\n----------\n\nWe now ensure that 403s are returned whether the user exists or not if the password is invalid or if the user does not exist.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/2a581d22cc621b33d5464ed65c4bc2057f72f011) for branch 3.4.\n\nCredits\n-------\n\nI would like to thank James Isaac and Mathias Brodala for reporting the issue and Robin Chalas for fixing the issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.2.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-guard"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0"
      }, {
        "fixed" : "3.4.48"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-guard"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.4.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-guard"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.2.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0"
      }, {
        "fixed" : "3.4.48"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.4.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.2.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "lexik/jwt-authentication-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.10.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "lexik/jwt-authentication-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.11.0"
      }, {
        "fixed" : "2.11.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/maker-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.27.0"
      }, {
        "fixed" : "1.29.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/maker-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.30.0"
      }, {
        "fixed" : "1.31.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.1.0"
      }, {
        "fixed" : "5.2.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0"
      }, {
        "fixed" : "3.4.49"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.4.24"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0"
      }, {
        "fixed" : "3.4.49"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.4.24"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.2.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-5pv8-ppvj-4h68"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21424"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/2a581d22cc621b33d5464ed65c4bc2057f72f011"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2021-21424"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VRUS2H2SSOQWNLBD35SKIWIDQEMV2PD3"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UC7BND775DVZDQT3RMGD2HVB2PKLJDJW"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RH7TMM5CHQYBFFGXWRPJDPB3SKCZXI2M"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KENRNLB3FYXYGDWRBH2PDBOZZKOD7VY4"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VRUS2H2SSOQWNLBD35SKIWIDQEMV2PD3"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UC7BND775DVZDQT3RMGD2HVB2PKLJDJW"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RH7TMM5CHQYBFFGXWRPJDPB3SKCZXI2M"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KENRNLB3FYXYGDWRBH2PDBOZZKOD7VY4"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/07/msg00014.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2021-21424.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/security/CVE-2021-21424.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/security-http/CVE-2021-21424.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/security-guard/CVE-2021-21424.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/maker-bundle/CVE-2021-21424.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/lexik/jwt-authentication-bundle/CVE-2021-21424.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-203" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-13T15:25:38Z",
    "nvd_published_at" : "2021-05-13T16:15:00Z"
  }
}