Premailer css_parser
css_parser: SSRF and Local File Disclosure in `CssParser::Parser#read_remote_file`
css_parser is a Ruby CSS parser. From 2.2.0 until 3.0.0, CssParser::Parser#read_remote_file in lib/css_parser/parser.rb, and therefore load_uri! and the @import-following branch of add_block!, issued HTTP and HTTPS requests against any host, port, and URI without a scheme allowlist, host or IP filtering, or protection against link-local, loopback, or RFC-1918 addresses. Location: redirects were followed recursively back into the same function, which also serviced file:// URIs, so a single attacker-controlled HTTP redirect could upgrade the bug from SSRF to arbitrary local file disclosure. Any consumer of css_parser that hands it attacker-influenced CSS together with a base_uri: option is exposed. This issue is fixed in version 3.0.0.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 3.0.0
Fixed in 3.0.0
Mitigation
Upgrade css_parser to 3.0.0 or later.
References
- Vendor advisory github.com/premailer/css_parser/security/advis…
- Patch github.com/premailer/css_parser/commit/7d2ddf0…
- Patch github.com/premailer/css_parser/commit/e0a1514…
1 more
- Release notes github.com/premailer/css_parser/releases/tag/v…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.