{"answers":{"affected":"2 open source packages ship an affected version, including smol-toml.","exploited":"There is no known exploitation of GHSA-pqhp-25j4-6hq9 in the wild and no public exploit code.","fix":"Upgrade smol-toml to 1.3.1 or later.","what":"GHSA-pqhp-25j4-6hq9 is a denial of service vulnerability in smol-toml, published on 22 Nov 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-pqhp-25j4-6hq9 and fix it if it is affected.\n\nWhat it is: GHSA-pqhp-25j4-6hq9 is a denial of service vulnerability in smol-toml, published on 22 Nov 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-pqhp-25j4-6hq9 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- smol-toml (npm): affected all versions; fixed in 1.3.1\n- smol-toml (npm): affected all versions; fixed in 1.3.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/GHSA-pqhp-25j4-6hq9/ (Markdown: https://insights.sbomify.com/GHSA-pqhp-25j4-6hq9/index.md)","id":"GHSA-pqhp-25j4-6hq9","markdown":"https://insights.sbomify.com/GHSA-pqhp-25j4-6hq9/index.md","name":"GHSA-pqhp-25j4-6hq9","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"JavaScript TOML parser","requires_auth":"none","summary":"An attacker can cause a denial of service by sending a deeply nested TOML document, crashing the application via stack overflow.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Summary\nAn attacker can send a maliciously crafted TOML to cause the parser to crash because of a stack overflow caused by a deeply nested inline structure. A similar problem occurs when attempting to stringify deeply nested objects.\n\nThe library does not limit the maximum exploration depth while parsing or producing TOML documents, nor does it offer a way to do so.\n\n### Proof of concept\n```js\nrequire(\"smol-toml\").parse(\"e=\" + \"{e=\".repeat(9999) + \"{}\" + \"}\".repeat(9999))\n```\n\n### Impact\nApplications which parse arbitrary TOML documents may suffer availability issues if they receive malicious input. If uncaught, the crash may cause the application itself to crash. The impact is deemed minor, as the function is already likely to throw errors on invalid input and therefore to properly handle errors.\n\nDue to the design of most JavaScript runtimes, the uncontrolled recursion does not lead to excessive memory usage and the execution is quickly aborted.\n\nAs a reminder, it is **strongly** advised when working with untrusted user input to expect errors to occur and to appropriately catch them.\n\n### Patches\nVersion 1.3.1 offers a mechanism to limit the exploration depth before halting with a `TomlError` when parsing, with a default cap of 1000. A same mechanism has been implemented for stringifying objects.\n\n**Please note that the parser will *still* throw an error upon such cases.** It is, however, a now-controlled and documented behavior of the library.\n\n### Workarounds\nWrap all invocations of `parse` and `stringify` in a try/catch block.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"smol-toml has a Denial of Service via malicious TOML document using deeply nested inline tables","id":"GHSA-pqhp-25j4-6hq9","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"denial_of_service","year":"2024"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["1.3.1"],"introduced":["0"],"last_affected":[],"package":"smol-toml","purl":null,"source":"GHSA-pqhp-25j4-6hq9"},{"ecosystem":"npm","fixed":["1.3.1"],"introduced":["0"],"last_affected":[],"package":"smol-toml","purl":"pkg:npm/smol-toml","source":"GHSA-pqhp-25j4-6hq9"}],"products":null,"published":"2024-11-22","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"An attacker can cause a denial of service by sending a deeply nested TOML document, crashing the application via stack overflow.","url":"https://insights.sbomify.com/GHSA-pqhp-25j4-6hq9/"}