CVE-2023-41336: Symfony/ux autocomplete Prevent Injection Of Invalid Entity Vulnerability

MODERATE
Advisory Identifier: GHSA-4cpv-669c-r79x
CVSS 6.5
CWE-20
Published
Advisory Summary

CVE-2023-41336 is a MODERATE (CVSS 6.5) prevent injection of invalid entity vulnerability (CWE-20: Improper Input Validation) affecting Symfony/ux autocomplete libraries in the Packagist ecosystem. The issue involves prevent injection of invalid entity ids for "autocomplete" fields. Remediation is available by upgrading affected packages to version 2.11.2.

CVE-2023-41336 at a Glance

CVE Identifier CVE-2023-41336
GHSA Identifier GHSA-4cpv-669c-r79x
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Symfony/ux autocomplete
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:L/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 Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-41336

To remediate this vulnerability, upgrade all affected Symfony/ux autocomplete 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/ux-autocomplete fixed: 2.11.2
Upgrade symfony/ux-autocomplete to 2.11.2
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/ux-autocomplete

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-41336, inspect your project dependencies for Symfony/ux autocomplete:

inspect dependencies for symfony/ux-autocomplete

Analyze the terminal output to locate any version of Symfony/ux autocomplete in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.11.2), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Symfony/ux autocomplete, 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

### Impact Under certain circumstances, an attacker could successfully submit an entity id for an `EntityType` that is *not* part of the valid choices. Affected applications are any that use: * A custom `query_builder` option to limit the valid results; AND * An `EntityType` with `'autocomplete' => true` or a custom [AsEntityAutocompleteField](https://symfony.com/bundles/ux-autocomplete/current/index.html#usage-in-a-form-with-ajax). Under this circumstance, if an id is submitted, it is accepted even if the matching record would not be returned by the custom query built with `query_builder`. ### Patches The problem has been fixed in `symfony/ux-autocomplete` version 2.11.2. ### Workarounds Upgrade to version 2.11.2 or greater of `symfony/ux-autocomplete` or perform extra validation after submit to verify the selected option is valid.

CVE-2023-41336 Affected Symfony/ux autocomplete Versions

1 component(s)
Fixed Versions:
2.11.2
Product / Package Ecosystem Affected Versions Fixed Version
symfony/ux-autocomplete
Packagist
< 2.11.2
2.11.2

References

Frequently Asked Questions

What is CVE-2023-41336?
CVE-2023-41336 is a security vulnerability in Symfony/ux autocomplete involving Prevent injection of invalid entity ids for "autocomplete" fields under CWE-20: Improper Input Validation.
Which Symfony/ux autocomplete versions are affected?
Affected versions include releases prior to 2.11.2 across affected packages: symfony/ux-autocomplete.
What version fixes CVE-2023-41336?
Upgrading to 2.11.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/ux-autocomplete affected?
Yes, symfony/ux-autocomplete is affected in releases prior to 2.11.2. Upgrade your dependency to 2.11.2 or later.
What is the CVSS score of CVE-2023-41336?
CVE-2023-41336 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2023-41336?
CVE-2023-41336 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Packagist dependencies for CVE-2023-41336?
Run the dependency tree command: 'inspect dependencies for symfony/ux-autocomplete'. 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-4cpv-669c-r79x",
  "modified" : "2023-09-11T14:43:05Z",
  "published" : "2023-09-11T14:43:05Z",
  "aliases" : [ "CVE-2023-41336" ],
  "summary" : "Prevent injection of invalid entity ids for \"autocomplete\" fields",
  "details" : "### Impact\nUnder certain circumstances, an attacker could successfully submit an entity id for an `EntityType` that is *not* part of the valid choices.\n\nAffected applications are any that use:\n\n* A custom `query_builder` option to limit the valid results;\nAND\n* An `EntityType` with `'autocomplete' => true` or a custom [AsEntityAutocompleteField](https://symfony.com/bundles/ux-autocomplete/current/index.html#usage-in-a-form-with-ajax).\n\nUnder this circumstance, if an id is submitted, it is accepted even if the matching record would not be returned by the custom query built with `query_builder`.\n\n### Patches\n\nThe problem has been fixed in `symfony/ux-autocomplete` version 2.11.2.\n\n### Workarounds\nUpgrade to version 2.11.2 or greater of `symfony/ux-autocomplete` or perform extra validation after submit to verify the selected option is valid.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/ux-autocomplete"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.11.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/ux-autocomplete/security/advisories/GHSA-4cpv-669c-r79x"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41336"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/ux-autocomplete/commit/fabcb2eee14b9e84a45b276711853a560b5d770c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/ux-autocomplete/CVE-2023-41336.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/ux-autocomplete"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/bundles/ux-autocomplete/current/index.html#usage-in-a-form-with-ajax"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-11T14:43:05Z",
    "nvd_published_at" : "2023-09-11T20:15:10Z"
  }
}