Serve-static is a widely used npm package that simplifies serving static files in Node.js applications, especially within the Express.js framework. Comparing versions 1.10.2 and 1.10.3, developers will find a few key distinctions that might influence their choice. The core functionality remains the same, focusing on efficiently serving static files with options for setting cache headers and handling conditional GET requests. However, the newer 1.10.3 version introduces an updated dependency on the send package (from 0.13.1 to 0.13.2), which handles the actual file serving and HTTP header negotiation. This update likely includes bug fixes or performance improvements within the send module, potentially leading to more reliable and efficient file delivery.
Beyond that, version 1.10.3 also brings significant updates to its development dependencies, adding tools like eslint (version 2.11.1) for code linting, eslint-plugin-promise (1.3.1), eslint-config-standard (5.3.1) and eslint-plugin-standard (1.3.2). These additions reflect a greater emphasis on code quality and adherence to JavaScript standards. This might positively impact the long-term maintenance and stability of the library but shouldn't directly affect the runtime behavior of applications using serve-static. The mocha testing framework was also updated from 2.3.4 to 2.5.3, and istanbul was also updated from 0.4.2 to 0.4.3. For developers, the choice between the versions hinges on whether they require the specific improvements within send (0.13.2) or if they're working in an environment sensitive to the versions of development dependencies. Generally, upgrading to the latest (1.10.3) is recommended unless compatibility issues arise.
All the vulnerabilities related to the version 1.10.3 of the package
serve-static vulnerable to template injection that can lead to XSS
passing untrusted user input - even after sanitizing it - to redirect()
may execute untrusted code
this issue is patched in serve-static 1.16.0
users are encouraged to upgrade to the patched version of express, but otherwise can workaround this issue by making sure any untrusted inputs are safe, ideally by validating them against an explicit allowlist
successful exploitation of this vector requires the following:
send vulnerable to template injection that can lead to XSS
passing untrusted user input - even after sanitizing it - to SendStream.redirect()
may execute untrusted code
this issue is patched in send 0.19.0
users are encouraged to upgrade to the patched version of express, but otherwise can workaround this issue by making sure any untrusted inputs are safe, ideally by validating them against an explicit allowlist
successful exploitation of this vector requires the following:
Vercel ms Inefficient Regular Expression Complexity vulnerability
A vulnerability, which was classified as problematic, has been found in vercel ms up to 1.x. This issue affects the function parse of the file index.js. The manipulation of the argument str leads to inefficient regular expression complexity. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. Upgrading to version 2.0.0 is able to address this issue. The name of the patch is caae2988ba2a37765d055c4eee63d383320ee662. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-217451.
mime Regular Expression Denial of Service when MIME lookup performed on untrusted user input
Affected versions of mime
are vulnerable to regular expression denial of service when a mime lookup is performed on untrusted user input.
Update to version 2.0.3 or later.
debug Inefficient Regular Expression Complexity vulnerability
A vulnerability classified as problematic has been found in debug-js debug up to 3.0.x. This affects the function useColors of the file src/node.js. The manipulation of the argument str leads to inefficient regular expression complexity. Upgrading to version 3.1.0 is able to address this issue. The name of the patch is c38a0166c266a679c8de012d4eaccec3f944e685. It is recommended to upgrade the affected component. The identifier VDB-217665 was assigned to this vulnerability. The patch has been backported to the 2.6.x branch in version 2.6.9.
Regular Expression Denial of Service in debug
Affected versions of debug
are vulnerable to regular expression denial of service when untrusted user input is passed into the o
formatter.
As it takes 50,000 characters to block the event loop for 2 seconds, this issue is a low severity issue.
This was later re-introduced in version v3.2.0, and then repatched in versions 3.2.7 and 4.3.1.
Version 2.x.x: Update to version 2.6.9 or later. Version 3.1.x: Update to version 3.1.0 or later. Version 3.2.x: Update to version 3.2.7 or later. Version 4.x.x: Update to version 4.3.1 or later.
Regular Expression Denial of Service in fresh
Affected versions of fresh
are vulnerable to regular expression denial of service when parsing specially crafted user input.
Update to version 0.5.2 or later.