CVE-2026-44312: CSS Parser Improper Certificate Validation Leads to MITM CSS Injection

css_parser Updated 07 May 2026

Summary

07/05/2026
Yes i
Moderate
5.8

CVE-2026-44312: CSS Parser: Improper Certificate Validation allows MITM injection of remote CSS content. Affects css_parser versions < 2.1.0. Fixed in 2.1.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The CSS Parser gem is a Ruby library designed to parse and manipulate CSS stylesheets. It allows developers to load and manage CSS from various sources, including remote URLs. However, the library has a critical vulnerability that arises from its failure to validate HTTPS connections, making it susceptible to man-in-the-middle (MITM) attacks.

Vulnerability Detail

The CSS Parser gem does not perform proper validation of HTTPS connections, as it sets the OpenSSL verify mode to VERIFY_NONE. This means that any HTTPS certificate, even untrusted ones, will be accepted without validation. Consequently, an attacker positioned to intercept network traffic can inject or modify CSS content loaded via HTTPS, leading to potential CSS injection and content manipulation attacks. This vulnerability affects all applications using the CSS Parser gem to fetch external stylesheets over HTTPS.

How To Fix

Minimum fixed version

2.1.0

This is the first release that contains the fix.

gem install css_parser -v 2.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can manually set the verify mode to a more secure option in your code, although this is not recommended as a long-term solution. Example code snippet:

http.verify_mode = OpenSSL::SSL::VERIFY_PEER

Conclusion

The CSS Parser gem has a significant vulnerability due to improper certificate validation, allowing for potential MITM attacks. Users are strongly advised to update to the latest version to mitigate risks. For those unable to update immediately, a temporary workaround is available, but it is not a substitute for a proper fix.

See every vulnerability recorded for css_parser →

Share this vulnerability

FAQ

The vulnerability allows attackers to inject or modify CSS content over HTTPS, potentially leading to unauthorized content manipulation and security breaches.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

All versions prior to 2.1.0 are affected by this vulnerability.

Yes, the vulnerability has been patched in version 2.1.0 of the CSS Parser gem.

If an immediate update is not possible, consider implementing the workaround to set the verify mode to VERIFY_PEER temporarily.

Related vulnerabilities

Recent vulnerabilities recorded for css_parser.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.1.0

This is the first release that contains the fix.

gem install css_parser -v 2.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback