This project contains known security vulnerabilities. Find detailed information at the bottom.

Crate mdbook

Dependencies

(26 total, 11 outdated, 1 insecure)

CrateRequiredLatestStatus
 ammonia ⚠️^3.3.04.2.5insecure
 anyhow^1.0.711.0.105up to date
 chrono^0.4.240.4.45up to date
 clap^4.3.124.6.10up to date
 clap_complete^4.3.24.6.12up to date
 elasticlunr-rs^3.0.23.1.0up to date
 env_logger^0.10.00.11.12out of date
 futures-util^0.3.280.3.34up to date
 handlebars^4.3.76.4.4out of date
 ignore^0.4.200.4.35up to date
 log^0.4.170.4.35up to date
 memchr^2.5.02.8.3up to date
 notify^6.0.19.0.0out of date
 notify-debouncer-mini^0.3.00.8.0out of date
 once_cell^1.17.11.21.4up to date
 opener^0.6.10.9.0out of date
 pulldown-cmark^0.9.30.13.6out of date
 regex^1.8.11.13.2up to date
 serde^1.0.1631.0.229up to date
 serde_json^1.0.961.0.154up to date
 shlex^1.1.02.0.1out of date
 tempfile^3.4.03.27.0up to date
 tokio^1.28.11.54.1up to date
 toml^0.5.111.2.3+spec-1.1.0out of date
 topological-sort^0.2.20.3.1out of date
 warp^0.3.50.4.4out of date

Dev dependencies

(6 total, all up-to-date)

CrateRequiredLatestStatus
 assert_cmd^2.0.112.2.2up to date
 predicates^3.0.33.1.4up to date
 pretty_assertions^1.3.01.4.1up to date
 select^0.6.00.6.1up to date
 semver^1.0.171.0.28up to date
 walkdir^2.3.32.5.1up to date

Security Vulnerabilities

ammonia: Incorrect escaping for `url("")` functions in CSS style attributes

RUSTSEC-2021-0157

In some cases, quotation marks in CSS url() functions are not escaped. This allows CSS injection. This feature is not enabled by default, so an application is vulnerable if, and only if, the style attribute is allowed and filter_style_properties is used.

As an example, this snippet:

<div style='background:url("cid:\");EVIL_CSS_HERE;background:url(\"cid:")'>

Would erroneously "sanitize" to:

<div style='background:url("cid:");EVIL_CSS_HERE;background:url("cid:")'>

This vulnerability was reported by Uttej Badwane

ammonia: XSS in ammonia via SVG `animateMotion`, `animateTransform`, and/or `animateColor` tags

RUSTSEC-2021-0158

The neutralization that ammonia applied to animate and set was not applied to other forms of SVG animation, which can be used for XSS.

The following SVG will produce a link with a javascript scheme. If the user clicks this link, they will run it.

<svg xmlns="http://www.w3.org/2000/svg">
  <a>
    <animateMotion attributeName="href" to="javascript:alert('SET_XSS')"></animateMotion>
    <text y="30">Click set</text>
  </a>
</svg>

Ammonia did not apply attribute filters based on attributeName, so the contents of the to, from, and values tags were not sanitized as URLs.

Applications that do not explicitly allow any of these tags should not be affected, since none are allowed by default.


This vulnerability was reported by ucsurf.

ammonia: Missing case-insensitive matching for CSS url function

RUSTSEC-2026-0373

URL filtering, such as relative URLs and URL scheme limits, is not always applied when CSS sanitization is used.

When the inner URL is quoted, CSS url("") is matched case-sensitively, when it should be matched case-insensitively. As a result, while url("") gets the intended domain name filtering, URL("") does not.

The following example shows how an application needs to be configured to trigger this bug.

let mut builder = Builder::new();
// allow inline styles
builder.filter_style_properties(hashset!["background-image"]);
builder.add_generic_attributes(&["style"]);
// notice that "http" URLs aren't allowed
builder.url_schemes(["cid"].into());

// attacker-controlled, presumably
let cleaned = builder.clean(r#"<div style='background:URL("https://evil.com/ping");'>"#);

// this is the expected result
assert_eq!(String::from(&cleaned), r#"<div style="">ok</p>"#);

// this is the result that the vulnerable version actually gets
assert_eq!(String::from(&cleaned), r#"<div style="background-image:URL(&quot;https://evil.com/ping&quot;);">ok</p>"#);

This can be used to inject tracking pixels where the application intended to prevent them. It does not allow XSS, and its usefulness for data exfiltration is limited.


This vulnerability was reported by Louis Li.