{"answers":{"affected":"2 open source packages ship an affected version, including less-openui5. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-21316 in the wild and no public exploit code.","fix":"Upgrade less-openui5 to 0.10.0 or later.","what":"CVE-2021-21316 is a medium-severity code injection vulnerability in SAP less-openui5, published on 16 Feb 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-21316 and fix it if it is affected.\n\nWhat it is: CVE-2021-21316 is a medium-severity code injection vulnerability in SAP less-openui5, published on 16 Feb 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-21316 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- less-openui5 (npm): affected all versions; fixed in 0.10.0\n- less-openui5 (npm): affected all versions; fixed in 0.10.0\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-2021-21316/ (Markdown: https://insights.sbomify.com/CVE-2021-21316/index.md)","id":"CVE-2021-21316","markdown":"https://insights.sbomify.com/CVE-2021-21316/index.md","name":"CVE-2021-21316","record":{"aliases":["GHSA-3crj-w4f5-gwh4"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"npm Less.js theme builder","requires_auth":"none","summary":"Attackers can execute arbitrary code during the build process by providing malicious Less files to the less-openui5 library.","user_interaction":"required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"less-openui5","vendor":"less-openui5_project"}],"cvss":{"score":6.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"}],"description":"less-openui5 is an npm package which enables building OpenUI5 themes with Less.js. In less-openui5 before version 0.10., when processing theming resources (i.e. `*.less` files) with less-openui5 that originate from an untrusted source, those resources might contain JavaScript code which will be executed in the context of the build process. While this is a feature of the Less.js library it is an unexpected behavior in the context of OpenUI5 and SAPUI5 development. Especially in the context of UI5 Tooling which relies on less-openui5. An attacker might create a library or theme-library containing a custom control or theme, hiding malicious JavaScript code in one of the .less files. Refer to the referenced GHSA-3crj-w4f5-gwh4 for examples. Starting with Less.js version 3.0.0, the Inline JavaScript feature is disabled by default. less-openui5 however currently uses a fork of Less.js v1.6.3. Note that disabling the Inline JavaScript feature in Less.js versions 1.x, still evaluates code has additional double codes around it. We decided to remove the inline JavaScript evaluation feature completely from the code of our Less.js fork. This fix is available in less-openui5 version 0.10.0.","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":"Arbitrary code execution in less-openui5","id":"CVE-2021-21316","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"code_injection","year":"2021"},"n_packages":2,"n_references":5,"next":{"headline":"Denial of Service in uap-core","id":"CVE-2021-21317"},"packages":[{"ecosystem":"npm","fixed":["0.10.0"],"introduced":["0"],"last_affected":[],"package":"less-openui5","purl":null,"source":"GHSA-3crj-w4f5-gwh4"},{"ecosystem":"npm","fixed":["0.10.0"],"introduced":["0"],"last_affected":[],"package":"less-openui5","purl":"pkg:npm/less-openui5","source":"GHSA-3crj-w4f5-gwh4"}],"prev":{"headline":"System Information Library for Node.JS Command Injection","id":"CVE-2021-21315"},"products":["less-openui5"],"published":"2021-02-16","related":[],"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":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["SAP"]},"summary":"Attackers can execute arbitrary code during the build process by providing malicious Less files to the less-openui5 library.","url":"https://insights.sbomify.com/CVE-2021-21316/"}