{"id":"RUSTSEC-2026-0174","aliases":["RUSTSEC-2026-0174"],"related":[],"kind":"vulnerability","state":"published","title":"`Authorization::value` and `WwwAuthenticate::value` can violate ASCII invariants","summary":"`Authorization::value` uses `HeaderValue::value` with the claim\nthat the internal string is ASCII, but `Authorization::new` and\n`Authorization::set_credentials` accept arbitrary `String` credentials without\nvalidation. As a result, safe code can construct a header value containing\nnon-ASCII UTF-8 while the implementation assumes ASCII.\n\n`WwwAuthenticate::new` and `WwwAuthenticate::set_realm` similarly accepts arbitrary `String` input, so `WwwAuthenticate::value` can also produce a header value that violates the crate’s documented ASCII invariants. \n\nThis issue has not been confirmed as Undefined Behavior, but the unsafe\njustification in `Authorization::value` and `WwwAuthenticate::value` appears incorrect and can produce values outside the expected ASCII-only constraints.\n\nThe http-types crate is unmaintained and the issue is unlikely to be fixed.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"`Authorization::value` uses `HeaderValue::value` with the claim\nthat the internal string is ASCII, but `Authorization::new` and\n`Authorization::set_credentials` accept arbitrary `String` credentials without\nvalidation. As a result, safe code can construct a header value containing\nnon-ASCII UTF-8 while the implementation assumes ASCII.\n\n`WwwAuthenticate::new` and `WwwAuthenticate::set_realm` similarly accepts arbitrary `String` input, so `WwwAuthenticate::value` can also produce a header value that violates the crate’s documented ASCII invariants. \n\nThis issue has not been confirmed as Undefined Behavior, but the unsafe\njustification in `Authorization::value` and `WwwAuthenticate::value` appears incorrect and can produce values outside the expected ASCII-only constraints.\n\nThe http-types crate is unmaintained and the issue is unlikely to be fixed.","format":"markdown","source":"rustsec"}],"published":"2026-03-11T12:00:00.000Z","modified":"2026-06-08T16:30:03.596Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected"}],"ecosystem":"crates.io","package":"http-types","purl":"pkg:cargo/http-types","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/http-types","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0174.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/http-rs/http-types/issues/534","tags":["report"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0174","url":"https://rustsec.org/advisories/RUSTSEC-2026-0174.html","licence":"CC0-1.0","modified":"2026-06-08T16:30:03.596Z"}],"updatedAt":"2026-11-25T22:56:43.369Z"}