CVE-2020-27543: Denial of Service (DoS) in restify-paginate
Summary
CVE-2020-27543: Denial of Service (DoS) in restify-paginate. Affects restify-paginate versions < 0.0.5. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The restify-paginate package is a Node.js module that provides pagination support for Restify-based web services. It allows developers to easily implement pagination functionality in their Restify applications. However, version 0.0.5 of the package is vulnerable to a Denial-of-Service (DoS) attack when the HTTP Host header is omitted. This vulnerability can be exploited remotely, causing the Restify-based web service to crash with an uncaught exception.
Vulnerability Detail
The vulnerability in restify-paginate (version 0.0.5) arises from a lack of proper input validation. When the HTTP Host header is not included in a request, the package fails to handle this scenario gracefully and crashes with an uncaught exception. This vulnerability can be exploited by an attacker to repeatedly send requests without the Host header, causing the targeted Restify-based web service to become unresponsive or crash. The impact of this vulnerability is a Denial-of-Service, preventing legitimate users from accessing the affected web service.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
If updating the package is not immediately feasible, a temporary workaround can be implemented by adding a custom middleware to the Restify application. This middleware should check for the presence of the Host header in incoming requests and handle the scenario appropriately. Here is an example of how the middleware can be implemented:
const restify = require('restify');
function customMiddleware(req, res, next) {
if (!req.headers.host) {
res.send(400, 'Bad Request');
} else {
next();
}
}
const server = restify.createServer();
server.use(customMiddleware);
// Rest of the application code
Conclusion
In conclusion, the restify-paginate package (version 0.0.5) is vulnerable to a Denial-of-Service (DoS) attack when the HTTP Host header is omitted. This vulnerability can be exploited remotely, causing the Restify-based web service to crash. To mitigate this vulnerability, it is recommended to update the package to a version that includes a fix. Alternatively, a temporary workaround can be implemented by adding a custom middleware to handle requests without the Host header. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for restify-paginate →
FAQ
The impact of this vulnerability is a Denial-of-Service (DoS) attack, which can render the affected Restify-based web service unresponsive or cause it to crash. Legitimate users will be unable to access the service while the attack is ongoing.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply provide the package-lock.json file of your application, and Vulert will analyze it in real-time to identify any open-source vulnerabilities, including this one.
Yes, a fix is available for this vulnerability. Developers should update the restify-paginate package to a version that includes the necessary patch. The recommended version to use is 0.0.6 or higher.
Yes, a temporary workaround can be implemented by adding a custom middleware to the Restify application. This middleware should check for the presence of the Host header in incoming requests and handle the scenario appropriately. Refer to the 'workaround' section for an example implementation.
You can find more information about this vulnerability in the GitHub Security Advisory database. The advisory for this vulnerability can be accessed at: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/04/GHSA-qr9h-vr5p-pwwx/GHSA-qr9h-vr5p-pwwx.json