{"answers":{"affected":"2 open source packages ship an affected version, including tarteaucitronjs. It affects 1 product.","exploited":"There is no known exploitation of CVE-2025-31475 in the wild and no public exploit code.","fix":"Upgrade tarteaucitronjs to 1.20.1 or later.","what":"CVE-2025-31475 is a medium-severity code injection vulnerability in AmauriC tarteaucitron.js, published on 7 Apr 2025. An attacker needs administrator access to exploit it, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2025-31475 and fix it if it is affected.\n\nWhat it is: CVE-2025-31475 is a medium-severity code injection vulnerability in AmauriC tarteaucitron.js, published on 7 Apr 2025. An attacker needs administrator access to exploit it, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2025-31475 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- tarteaucitronjs (npm): affected all versions; fixed in 1.20.1\n- tarteaucitronjs (npm): affected all versions; fixed in 1.20.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-31475/ (Markdown: https://insights.sbomify.com/CVE-2025-31475/index.md)","id":"CVE-2025-31475","markdown":"https://insights.sbomify.com/CVE-2025-31475/index.md","name":"CVE-2025-31475","record":{"aliases":["GHSA-4hwx-xcc5-2hfc"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"JavaScript cookie banner","requires_auth":"high_privilege","summary":"Attackers with source code access can inject malicious prototypes in tarteaucitron.js, potentially causing code execution or application crashes.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"tarteaucitronjs","vendor":"amauri"}],"cvss":{"score":5.5,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-1321","name":"Improperly Controlled Modification of Object Prototype Attributes"}],"description":"tarteaucitron.js is a compliant and accessible cookie banner. A vulnerability was identified in tarteaucitron.js prior to 1.20.1, where the addOrUpdate function, used for applying custom texts, did not properly validate input. This allowed an attacker with direct access to the site's source code or a CMS plugin to manipulate JavaScript object prototypes, leading to potential security risks such as data corruption or unintended code execution. An attacker with high privileges could exploit this vulnerability to modify object prototypes, affecting core JavaScript behavior, cause application crashes or unexpected behavior, or potentially introduce further security vulnerabilities depending on the application's architecture. This vulnerability is fixed in 1.20.1.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"tarteaucitron.js allows prototype pollution via custom text injection","id":"CVE-2025-31475","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"code_injection","year":"2025"},"n_packages":2,"n_references":2,"next":{"headline":"tarteaucitron.js allows url scheme injection via unfiltered inputs","id":"CVE-2025-31476"},"packages":[{"ecosystem":"npm","fixed":["1.20.1"],"introduced":["0"],"last_affected":[],"package":"tarteaucitronjs","purl":null,"source":"GHSA-4hwx-xcc5-2hfc"},{"ecosystem":"npm","fixed":["1.20.1"],"introduced":["0"],"last_affected":[],"package":"tarteaucitronjs","purl":"pkg:npm/tarteaucitronjs","source":"GHSA-4hwx-xcc5-2hfc"}],"prev":{"headline":"WordPress WP Database Optimizer plugin \u003c= 1.2.1.3 - Cross Site Request Forgery (CSRF) Vulnerability","id":"CVE-2025-31474"},"products":["tarteaucitron.js"],"published":"2025-04-07","related":[{"cvss_score":5.5,"headline":"tarteaucitron.js allows UI manipulation via unrestricted CSS injection","id":"CVE-2025-31138","kev_date_added":null,"published":"2025-04-07"},{"cvss_score":4.8,"headline":"tarteaucitron.js allows url scheme injection via unfiltered inputs","id":"CVE-2025-31476","kev_date_added":null,"published":"2025-04-07"},{"cvss_score":4.4,"headline":"tarteaucitron.js has Regular Expression Denial of Service (ReDoS) vulnerability","id":"CVE-2026-22809","kev_date_added":null,"published":"2026-01-13"},{"cvss_score":4.2,"headline":"tarteaucitron.js vulnerable to DOM Clobbering via document.currentScript","id":"CVE-2025-48939","kev_date_added":null,"published":"2025-07-03"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-07","vendors":["AmauriC"]},"summary":"Attackers with source code access can inject malicious prototypes in tarteaucitron.js, potentially causing code execution or application crashes.","url":"https://insights.sbomify.com/CVE-2025-31475/"}