CVE Catalog

GHSA-w3mx-4vv9-hjpg

Medium
Published: —Translated: NVD NIST

Summary

When css_parser parses CSS containing an @import rule and the caller has supplied a :base_dir option (but not a :base_uri), the attacker-controlled import path is passed directly into load_file!, which does File.expand_path(file_name, base_dir) followed by File.read with no path containment.

Risk Assessment

An attacker can inject a malicious import path, potentially leading to arbitrary file read from the server's filesystem. This could result in leakage of sensitive data such as configuration files or keys.

Recommendation

Update css_parser to a version containing the fix or avoid using the :base_dir option without :base_uri. Consider validating and sanitizing import paths before passing them to the parser.

Other vulnerabilities in css_parser

See all
Original NVD description (English source)

## Summary When css_parser parses CSS that contains an @import rule and the caller has supplied a :base_dir option (but not a :base_uri), the attacker-controlled import path is passed directly into load_file!, which does File.expand_path(file_name, base_dir) followed by File.read with no path conta

Vulnerability data from NVD (NIST) · CISA KEV · EPSS