CVE-2018-1000096: Vulnerability in tiny-json-http
Summary
CVE-2018-1000096: tiny-json-http missing SSL certificate validation. Affects tiny-json-http versions >= 1.0.1, < 7.0.0. Fixed in 7.0.0. 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
tiny-json-http is an npm package that provides a lightweight HTTP client for making JSON-based HTTP requests. It is widely used in Node.js applications to interact with RESTful APIs. The vulnerability affects all versions of tiny-json-http since commit 9b8e74a232bba4701844e07bcba794173b0238a8 (Oct 29 2016).
Vulnerability Detail
The vulnerability in tiny-json-http is a Missing SSL certificate validation issue. This means that the package does not properly validate SSL certificates when making HTTP requests. As a result, it exposes users to man-in-the-middle attacks, where an attacker can intercept and modify the communication between the client and the server. This can lead to unauthorized access, data tampering, and other security breaches.
How To Fix
Minimum fixed version
7.0.0
This is the first release that contains the fix.
npm install tiny-json-http@7.0.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If you are unable to immediately update the package, a temporary workaround is to manually validate SSL certificates in your code before making HTTP requests using tiny-json-http. Here is an example of how to do this in Node.js:
const https = require('https');
const tls = require('tls');
const options = {
hostname: 'example.com',
port: 443,
path: '/api',
method: 'GET',
checkServerIdentity: (hostname, cert) => {
const error = tls.checkServerIdentity(hostname, cert);
if (error) {
throw new Error(`Invalid SSL certificate: ${error}`);
}
}
};
https.request(options, (res) => {
// Handle the response
});
Conclusion
The vulnerability in tiny-json-http exposes users to man-in-the-middle attacks due to the lack of SSL certificate validation. It is recommended to update the package to the latest version or manually validate SSL certificates in your code. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tiny-json-http →
FAQ
tiny-json-http is an npm package that provides a lightweight HTTP client for making JSON-based HTTP requests in Node.js applications.
All versions of tiny-json-http since commit 9b8e74a232bba4701844e07bcba794173b0238a8 (Oct 29 2016) are affected.
This vulnerability exposes users to man-in-the-middle attacks, where an attacker can intercept and modify the communication between the client and the server. This can lead to unauthorized access, data tampering, and other security breaches.
To fix this vulnerability, update the tiny-json-http package to version 7.0.0 or later.
If you are unable to immediately update the package, you can manually validate SSL certificates in your code before making HTTP requests using tiny-json-http.