CVE-2026-44312
JSON

5.8medium

css_parser allows to MITM included https css urls

Severity
5.8medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.15% (higher than 4% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-ff6c-w6qf-7xqc

Description

css_parser is a Ruby CSS parser. Prior to 2.1.0 and 1.22.0, the CSS Parser gem does not validate HTTPS connections, allowing a Man-in-the-Middle (MITM) attacker to inject or modify CSS content when stylesheets are loaded via HTTPS. The connection is established with OpenSSL::SSL::VERIFY_NONE, meaning any HTTPS certificate—even entirely untrusted—will be accepted without validation. This vulnerability is fixed in 2.1.0 and 1.22.0.

Affected

Product or packageVersionsReported by
premailer css_parser>= 2.0.0, < 2.1.0, < 1.22.0CVE List
css_parser (RubyGems)from 2.0.0 before 2.1.0, before 1.22.0GitHub Advisory Database

All scores

GitHub_M5.8medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N
GitHub5.8medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N

Classification

CWE-295CWE-829

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

css_parser is a Ruby CSS parser. Prior to 2.1.0 and 1.22.0, the CSS Parser gem does not validate HTTPS connections, allowing a Man-in-the-Middle (MITM) attacker to inject or modify CSS content when stylesheets are loaded via HTTPS. The connection is established with OpenSSL::SSL::VERIFY_NONE, meaning any HTTPS certificate—even entirely untrusted—will be accepted without validation. This vulnerability is fixed in 2.1.0 and 1.22.0.

GitHub Advisory Database
Summary

The CSS Parser gem does not validate HTTPS connections, allowing a Man-in-the-Middle (MITM) attacker to inject or modify CSS content when stylesheets are loaded via HTTPS. The connection is established with OpenSSL::SSL::VERIFY_NONE, meaning any HTTPS certificate—even entirely untrusted—will be accepted without validation.

Details

In lib/css_parser/parser.rb, the HTTP client sets: https://github.com/premailer/css_parser/blob/3f91e8db7547fac50ab50cb7f9920f785f722740/lib/css_parser/parser.rb#L646

http.verify_mode = OpenSSL::SSL::VERIFY_NONE

As a result, the library does not validate the authenticity of HTTPS connections and does not protect against man-in-the-middle attacks. Any attacker in a position to intercept network traffic can inject or modify CSS loaded via HTTPS URLs without detection or warning.

PoC
  1. Set up a test Ruby project that uses the CSS Parser gem and loads an external stylesheet over HTTPS.
  2. Use a local proxy (such as mitmproxy or Burp Suite) to intercept outgoing HTTPS requests.
  3. Present a fake self-signed certificate to the client.
  4. Inject custom CSS into the intercepted HTTPS response.

The request will succeed and the injected CSS will be delivered to the application, as the connection is not validated.

References

https://github.com/premailer/css_parser/issues/185

Impact

Applications using CSS Parser to load remote stylesheets over HTTPS are vulnerable to CSS injection and content manipulation, regardless of the trust status of the remote server. All users who use CSS Parser to fetch external CSS over HTTPS may be impacted.

Credit

This vulnerability was uncovered by @JLLeitschuh of the @braze-inc security team.

NVD (es)

css_parser es un analizador CSS de Ruby. Antes de las versiones 2.1.0 y 1.22.0, la gema CSS Parser no valida las conexiones HTTPS, permitiendo a un atacante man-in-the-middle (MitM) inyectar o modificar contenido CSS cuando las hojas de estilo se cargan a través de HTTPS. La conexión se establece con OpenSSL::SSL::VERIFY_NONE, lo que significa que cualquier certificado HTTPS -incluso los completamente no confiables- será aceptado sin validación. Esta vulnerabilidad está corregida en las versiones 2.1.0 y 1.22.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-44312 changed 2026-05-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-ff6c-w6qf-7xqc changed 2026-06-08CC-BY-4.0
NVDCVE-2026-44312 changed 2026-10-26Public domain