CVE-2026-44312: CSS Parser Improper Certificate Validation Vulnerability
MODERATECVE-2026-44312 is a MODERATE (CVSS 5.8) improper certificate validation vulnerability (CWE-829: Inclusion of Functionality from Untrusted Control Sphere) affecting CSS Parser libraries in the RubyGems ecosystem. The issue involves improper certificate validation allows mitm injection of remote css content. Remediation is available by upgrading affected packages to version 2.1.0, 1.22.0.
CVE-2026-44312 at a Glance
Security Impact
CVSS: 5.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N).
How to Fix CVE-2026-44312
To remediate this vulnerability, upgrade all affected CSS Parser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade css_parser to 2.1.0
Upgrade css_parser to 1.22.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for css_parser
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-44312, inspect your project dependencies for CSS Parser:
inspect dependencies for css_parser
Analyze the terminal output to locate any version of CSS Parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-829: Inclusion of Functionality from Untrusted Control Sphere, where the product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. In CSS Parser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-44312 Affected CSS Parser Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
css_parser
|
RubyGems |
≥ 2.0.0
< 2.1.0
|
2.1.0
|
|
css_parser
|
RubyGems |
< 1.22.0
|
1.22.0
|
References
Frequently Asked Questions
What is CVE-2026-44312?
Which CSS Parser versions are affected?
What version fixes CVE-2026-44312?
Is css_parser affected?
What is the CVSS score of CVE-2026-44312?
What CWE is associated with CVE-2026-44312?
How can I check RubyGems dependencies for CVE-2026-44312?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-ff6c-w6qf-7xqc",
"modified" : "2026-06-08T23:18:03Z",
"published" : "2026-05-07T02:06:49Z",
"aliases" : [ "CVE-2026-44312" ],
"summary" : "CSS Parser: Improper Certificate Validation allows MITM injection of remote CSS content",
"details" : "### Summary\n\nThe 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.\n\n### Details\n\nIn `lib/css_parser/parser.rb`, the HTTP client sets:\nhttps://github.com/premailer/css_parser/blob/3f91e8db7547fac50ab50cb7f9920f785f722740/lib/css_parser/parser.rb#L646\n\n```ruby\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n```\n\nAs 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.\n\n### PoC\n\n1. Set up a test Ruby project that uses the CSS Parser gem and loads an external stylesheet over HTTPS.\n2. Use a local proxy (such as mitmproxy or Burp Suite) to intercept outgoing HTTPS requests.\n3. Present a fake self-signed certificate to the client.\n4. Inject custom CSS into the intercepted HTTPS response.\n \nThe request will succeed and the injected CSS will be delivered to the application, as the connection is not validated.\n\n### References\n \nhttps://github.com/premailer/css_parser/issues/185\n\n### Impact\n\nApplications 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.\n\n### Credit\n\nThis vulnerability was uncovered by @JLLeitschuh of the @braze-inc security team.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "css_parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.1.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "css_parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.22.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/premailer/css_parser/security/advisories/GHSA-ff6c-w6qf-7xqc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-44312"
}, {
"type" : "WEB",
"url" : "https://github.com/premailer/css_parser/issues/185"
}, {
"type" : "WEB",
"url" : "https://github.com/premailer/css_parser/commit/35e689c904225add78e0c488cf04bad052666449"
}, {
"type" : "WEB",
"url" : "https://github.com/premailer/css_parser/commit/e0c95d5abe91b237becb90ff316531a6547ada18"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/premailer/css_parser"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/css_parser/CVE-2026-44312.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-295", "CWE-829" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-07T02:06:49Z",
"nvd_published_at" : "2026-05-14T17:16:22Z"
}
}