{"id":"CVE-2026-68538","aliases":["GHSA-395p-pj7r-jm42"],"url":"https://o3.security/vulnerability/CVE-2026-68538","summary":"fulgur: Unbounded counters() expansion in generated content causes memory/CPU exhaustion (denial of service)","details":"`fulgur` converts untrusted HTML/CSS into PDF, commonly on a server that processes input supplied by many tenants. In versions from 0.15.0 up to (but not including) the patched release, resolving the CSS `counters(name, sep)` function in generated content was bounded neither in the size of a single expansion nor in the aggregate work across an element tree.\n\nA CSS counter chain grows by one entry per `counter-reset`, and per CSS Lists 3 §4.4 a reset is scoped to the originating element, its descendants, and its following siblings — so among N sibling elements the i-th element's active chain has about `i` entries. `counters(name, sep)` joins that chain with an attacker-controlled separator string, and each matching element emits its own resolved copy. A document such as:\n\n```html\n<style>\n  div { counter-reset: x }\n  div::before { content: counters(x, \"……long separator……\") }\n</style>\n<div></div>  <!-- repeated many times -->\n```\n\ntherefore expands to roughly `separator_len × N² / 2` bytes of generated content from a few kilobytes of input — a super-linear amplification. The same `counters()` resolution feeds three sinks: the generated CSS injected for `::before` / `::after`, the PDF outline built from `bookmark-label`, and the per-node counter-state snapshots retained during resolution (the last is an O(N²) **memory** sink even when it produces no visible output). An attacker able to submit HTML/CSS to a fulgur-based conversion service can trigger CPU and memory exhaustion with a trivially small payload, denying service to the host and any co-tenants.\n\n## Patches\n\nFixed in **0.27.0**. Each single `counters()` expansion is capped\n(`MAX_COUNTER_CHAIN_BYTES`), and the aggregate of each sink — the generated CSS\n(`MAX_GENERATED_CSS_BYTES`), the outline labels (`MAX_OUTLINE_LABEL_BYTES`), and\nthe retained per-node counter snapshots (`MAX_COUNTER_SNAPSHOT_ENTRIES`) — is\nseparately bounded, so a crafted document can no longer amplify a small input                                 into unbounded output or memory. The caps are far above any realistic document.\n\n## Workarounds\n\nUpgrade to 0.27.0 or later. If upgrading is not immediately possible, validate or constrain untrusted CSS (in particular `counter-reset` on many sibling elements combined with a long `counters()` separator) before passing HTML to fulgur.\n\n## Attack Vector rationale\n\n`fulgur` performs no network I/O of its own; it renders HTML/CSS handed to it by the embedding application. This advisory scores the crate independent of any specific adopting program, so per the CVSS v3.1 User Guide §3.7 (scoring library vulnerabilities related to incoming data) the Attack Vector is assessed as **Network** for the reasonable worst-case deployment — a network-facing service that renders untrusted, attacker-supplied HTML without user interaction. A concrete system that receives the HTML in one component and passes it to fulgur in a separate component may assess a lower environmental Attack Vector (Local, per §3.10).\n\n## Resources\n\n- Fixed in release: https://github.com/fulgur-rs/fulgur/releases/tag/v0.27.0","published":"2026-11-11T22:12:06.386Z","modified":"2026-11-17T20:45:23.275643775Z","cvss":{"score":7.5,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"epss":{"score":0.00638,"percentile":0.51997,"asOf":"2026-12-04"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"crates.io","name":"fulgur","fixedVersion":"0.27.0"}],"fix":{"url":"https://github.com/fulgur-rs/fulgur/commit/ebc75691ad368f1c1a211543313b04da2af466d6","label":"fulgur-rs/fulgur@ebc7569"},"references":[{"type":"WEB","url":"https://github.com/fulgur-rs/fulgur/releases/tag/v0.27.0"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/68xxx/CVE-2026-68538.json"},{"type":"ADVISORY","url":"https://github.com/fulgur-rs/fulgur/security/advisories/GHSA-395p-pj7r-jm42"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-68538"},{"type":"FIX","url":"https://github.com/fulgur-rs/fulgur/commit/ebc75691ad368f1c1a211543313b04da2af466d6"},{"type":"PACKAGE","url":"https://github.com/fulgur-rs/fulgur"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-11-17T20:45:23.275643775Z"}}