{"answers":{"affected":"1 open source package ship an affected version, including kuva.","exploited":"There is no known exploitation of RUSTSEC-2026-0345 in the wild and no public exploit code.","fix":"Upgrade kuva to a fixed version for your release line: 0.3.1 or 0.4.1.","what":"RUSTSEC-2026-0345 is a cross-site scripting vulnerability in kuva, published on 7 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for RUSTSEC-2026-0345 and fix it if it is affected.\n\nWhat it is: RUSTSEC-2026-0345 is a cross-site scripting vulnerability in kuva, published on 7 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of RUSTSEC-2026-0345 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- kuva (crates.io): affected from 0.1.5; fixed in 0.3.1, 0.4.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/RUSTSEC-2026-0345/ (Markdown: https://insights.sbomify.com/RUSTSEC-2026-0345/index.md)","id":"RUSTSEC-2026-0345","markdown":"https://insights.sbomify.com/RUSTSEC-2026-0345/index.md","name":"RUSTSEC-2026-0345","record":{"aliases":["GHSA-3c48-9r95-hqhr"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","security_bypass"],"network_reachable":"yes","non_default_config":true,"product_category":"Rust plotting library","requires_auth":"none","summary":"Attackers can inject malicious scripts or terminal escape sequences via untrusted labels in SVG or terminal outputs, requiring user interaction to execute.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"Affected versions of `kuva` wrote data-derived strings straight into rendered\noutput without escaping them for the target format. Applications that plot\nuntrusted input (column headers, category and group names, series labels)\nwere affected in three places.\n\n**1. SVG attribute injection / stored XSS (CWE-79).** When SVG interactivity\nwas enabled via `Layout::with_interactive`, group and category labels were\nformatted directly into `data-group` and `data-x` attributes through the raw\n`Primitive::GroupStart.extra_attrs` string, which the SVG backend emitted\nverbatim. The backend's escaping helper covered text nodes and `\u003ctitle\u003e` but\nnot attributes. A label containing a double quote could close the attribute\nand add another, for example an event handler. Opening the resulting SVG in a\nbrowser, or inlining it into an HTML page, executed the injected script.\nReachable from scatter, line, bar, and strip plots, and from legends.\n\n**2. Unvalidated CSS and style attribute values (CWE-74).** `Color::Css`\nwrote arbitrary strings into `fill` and `stroke`, `stroke-dasharray` was\nemitted raw from the public dash-pattern builders, and the SVG root\n`font-family` and `fill` plus the background rectangle `fill` were written\nraw from layout and theme configuration. Applications that forwarded\nuser-supplied style values into the plotting API could have those values\nbreak out of the attribute they were written into.\n\n**3. Terminal escape sequence injection (CWE-150).** `TerminalBackend` stored\nlabel characters unfiltered and emitted each one unconditionally when\nproducing its ANSI string. Control characters in a label, including ESC, OSC\nsequences, and carriage returns, were written straight to the operator's\nterminal. Depending on the emulator this allows forged or misleading output,\nwindow title and clipboard manipulation, and reaching terminal emulator\nvulnerabilities that are triggered by escape sequences.\n\nThe fix routes every data-derived string through format-appropriate\nescaping. A single `escape_attr` helper XML-escapes `\u0026`, `\u003c`, `\u003e`, `\"`, and\n`'`, and is applied at each raw-attribute site: the `extra_attrs`\ninterpolations, the `Color::Css` catch-all, and the SVG backend's\n`stroke-dasharray`, `font-family`, and background `fill` writes.\n`TerminalBackend::set_char` replaces control characters with U+FFFD before\nthey enter the character grid, so one cell stays one column rather than the\ngrid shifting, and the ANSI writer emits the grid unchanged.\n\nPatched in 0.5.0, with backports to 0.4.1 for the 0.4.x line and 0.3.1 for\nusers still on 0.1.5 through 0.3.0. No versions were yanked.\n\nUsers who cannot upgrade should sanitize labels before passing them to\n`kuva`, and avoid interactive SVG output for untrusted data.\n\nNote that `Scene::defs`, `Scene::scripts`, and `Primitive::GroupStart.extra_attrs`\nremain raw escape hatches by design. They are documented as trusted-only and\nare not covered by this advisory; populating them from user data is\nequivalent to executing that data.","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Untrusted labels can inject SVG attributes, CSS values, and terminal escape sequences","id":"RUSTSEC-2026-0345","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"xss","year":"2026"},"n_packages":1,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["0.3.1","0.4.1"],"introduced":["0.1.5","0.4.0"],"last_affected":[],"package":"kuva","purl":"pkg:cargo/kuva","source":"RUSTSEC-2026-0345"}],"products":null,"published":"2026-08-07","related":[],"sources":[{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can inject malicious scripts or terminal escape sequences via untrusted labels in SVG or terminal outputs, requiring user interaction to execute.","url":"https://insights.sbomify.com/RUSTSEC-2026-0345/"}