GHSA-q257-vv4p-fg92

Suggest an improvement
Source
https://github.com/advisories/GHSA-q257-vv4p-fg92
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/11/GHSA-q257-vv4p-fg92/GHSA-q257-vv4p-fg92.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-q257-vv4p-fg92
Aliases
Published
2018-11-09T17:49:34Z
Modified
2023-11-01T04:47:45.820582Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N CVSS Calculator
Summary
Header Forgery in http-signature
Details

Affected versions of http-signature contain a vulnerability which can allow an attacker in a privileged network position to modify header names and change the meaning of the request, without requiring an updated signature.

This problem occurs because vulnerable versions of http-signature sign the contents of headers, but not the header names.

Proof of Concept

Consider this to be the initial, untampered request:

POST /pay HTTP/1.1
Host: example.com
Date: Thu, 05 Jan 2012 21:31:40 GMT
X-Payment-Source: src@money.com
X-Payment-Destination: dst@money.com
Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="x-payment-source x-payment-destination" MDyO5tSvin5...

And the request is intercepted and tampered as follows:

X-Payment-Source: dst@money.com // Emails switched
X-Payment-Destination: src@money.com
Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="x-payment-destination x-payment-source" MDyO5tSvin5...

In the resulting responses, both requests would pass signature verification without issue.

src@money.com\n
dst@money.com\n

Recommendation

Update to version 0.10.0 or higher.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-20"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:50:21Z"
}
References

Affected packages

npm / http-signature

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.10.0