RubySec

Providing security resources for the Ruby community

CVE-2026-53727 (css_parser): SSRF and Local File Disclosure in `CssParser::Parser#read_remote_file`

SSRF and Local File Disclosure in `CssParser::Parser#read_remote_file`

Published: June 01, 2026

SECURITY IDENTIFIERS

GEM

css_parser

UNAFFECTED VERSIONS

< 2.2.0

PATCHED VERSIONS

>= 3.0.0

DESCRIPTION

Summary

CssParser::Parser#read_remote_file (and therefore load_uri!, and the @import-following branch of add_block!) issues HTTP/HTTPS requests against any host, port and URI it is handed, with no scheme allowlist, no host / IP filtering, and no protection against link-local, loopback or RFC‑1918 addresses. Location: redirects are followed recursively back into the same function, which also services file:// URIs, so a single attacker-controlled HTTP redirect upgrades the bug from SSRF to arbitrary local file disclosure.

In practice, any consumer of css_parser that hands it attacker‑influenced CSS together with a base_uri: option — Premailer being the canonical example — is exposed. The attacker only needs the ability to land one @import url(…) in the CSS that the host application parses.

RELATED