Skip to content

Commit 8950bde

Browse files
committed
test: add coverage for parsing cvss v3.0 vectors in osv advisories
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 04f57a8 commit 8950bde

3 files changed

Lines changed: 140 additions & 0 deletions

File tree

vulnerabilities/tests/pipes/test_osv_v2.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,13 @@ def test_to_advisories_pypa7(self):
293293
)
294294
result = imported_data.to_dict()
295295
util_tests.check_results_against_json(result, expected_file)
296+
297+
def test_to_advisories_pypa8_cvss_v3_0_parsing(self):
298+
with open(os.path.join(TEST_DATA, "pypa/pypa-8.yaml")) as f:
299+
mock_response = saneyaml.load(f)
300+
expected_file = os.path.join(TEST_DATA, "pypa/pypa-expected-8.json")
301+
imported_data = parse_advisory_data_v3(
302+
mock_response, "pypi", advisory_url="https://test.com", advisory_text=""
303+
)
304+
result = imported_data.to_dict()
305+
util_tests.check_results_against_json(result, expected_file, regen=True)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
id: PYSEC-2024-26
2+
modified: 2024-02-06T20:20:18.162431Z
3+
published: 2024-01-29T23:15:00Z
4+
aliases:
5+
- CVE-2024-23829
6+
- GHSA-8qpw-xqxj-h4r2
7+
details: aiohttp is an asynchronous HTTP client/server framework for asyncio and Python.
8+
Security-sensitive parts of the Python HTTP parser retained minor differences in
9+
allowable character sets, that must trigger error handling to robustly match frame
10+
boundaries of proxies in order to protect against injection of additional requests.
11+
Additionally, validation could trigger exceptions that were not handled consistently
12+
with processing of other malformed input. Being more lenient than internet standards
13+
require could, depending on deployment environment, assist in request smuggling.
14+
The unhandled exception could cause excessive resource consumption on the application
15+
server and/or its logging facilities. This vulnerability exists due to an incomplete
16+
fix for CVE-2023-47627. Version 3.9.2 fixes this vulnerability.
17+
affected:
18+
- package:
19+
ecosystem: PyPI
20+
name: aiohttp
21+
purl: pkg:pypi/aiohttp
22+
ranges:
23+
- type: GIT
24+
events:
25+
- introduced: "0"
26+
- fixed: 33ccdfb0a12690af5bb49bda2319ec0907fa7827
27+
repo: https://github.com/aio-libs/aiohttp
28+
- type: ECOSYSTEM
29+
events:
30+
- introduced: "0"
31+
- fixed: 3.9.2
32+
versions:
33+
- "0.1"
34+
- 0.10.0
35+
- 0.10.1
36+
- 0.10.2
37+
- 0.11.0
38+
- 0.12.0
39+
- 0.13.0
40+
- 0.13.1
41+
severity:
42+
- type: CVSS_V3
43+
score: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
44+
references:
45+
- type: EVIDENCE
46+
url: https://github.com/aio-libs/aiohttp/security/advisories/GHSA-8qpw-xqxj-h4r2
47+
- type: FIX
48+
url: https://github.com/aio-libs/aiohttp/security/advisories/GHSA-8qpw-xqxj-h4r2
49+
- type: ADVISORY
50+
url: https://github.com/aio-libs/aiohttp/security/advisories/GHSA-8qpw-xqxj-h4r2
51+
- type: FIX
52+
url: https://github.com/aio-libs/aiohttp/pull/8074
53+
- type: FIX
54+
url: https://github.com/aio-libs/aiohttp/commit/33ccdfb0a12690af5bb49bda2319ec0907fa7827
55+
- type: ARTICLE
56+
url: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XXWVZIVAYWEBHNRIILZVB3R3SDQNNAA7/
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"advisory_id": "PYSEC-2024-26",
3+
"aliases": [
4+
"CVE-2024-23829",
5+
"GHSA-8qpw-xqxj-h4r2"
6+
],
7+
"summary": "aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. Security-sensitive parts of the Python HTTP parser retained minor differences in allowable character sets, that must trigger error handling to robustly match frame boundaries of proxies in order to protect against injection of additional requests. Additionally, validation could trigger exceptions that were not handled consistently with processing of other malformed input. Being more lenient than internet standards require could, depending on deployment environment, assist in request smuggling. The unhandled exception could cause excessive resource consumption on the application server and/or its logging facilities. This vulnerability exists due to an incomplete fix for CVE-2023-47627. Version 3.9.2 fixes this vulnerability.",
8+
"affected_packages": [
9+
{
10+
"package": {
11+
"type": "pypi",
12+
"namespace": "",
13+
"name": "aiohttp",
14+
"version": "",
15+
"qualifiers": "",
16+
"subpath": ""
17+
},
18+
"affected_version_range": "vers:pypi/0.1|0.10.0|0.10.1|0.10.2|0.11.0|0.12.0|0.13.0|0.13.1",
19+
"fixed_version_range": "vers:pypi/3.9.2",
20+
"introduced_by_commit_patches": [],
21+
"fixed_by_commit_patches": [
22+
{
23+
"vcs_url": "https://github.com/aio-libs/aiohttp",
24+
"commit_hash": "33ccdfb0a12690af5bb49bda2319ec0907fa7827",
25+
"patch_text": null,
26+
"patch_checksum": null
27+
}
28+
]
29+
}
30+
],
31+
"references": [
32+
{
33+
"reference_id": "",
34+
"reference_type": "",
35+
"url": "https://github.com/aio-libs/aiohttp/security/advisories/GHSA-8qpw-xqxj-h4r2"
36+
},
37+
{
38+
"reference_id": "",
39+
"reference_type": "",
40+
"url": "https://github.com/aio-libs/aiohttp/security/advisories/GHSA-8qpw-xqxj-h4r2"
41+
},
42+
{
43+
"reference_id": "",
44+
"reference_type": "",
45+
"url": "https://github.com/aio-libs/aiohttp/security/advisories/GHSA-8qpw-xqxj-h4r2"
46+
},
47+
{
48+
"reference_id": "",
49+
"reference_type": "",
50+
"url": "https://github.com/aio-libs/aiohttp/pull/8074"
51+
},
52+
{
53+
"reference_id": "",
54+
"reference_type": "",
55+
"url": "https://github.com/aio-libs/aiohttp/commit/33ccdfb0a12690af5bb49bda2319ec0907fa7827"
56+
},
57+
{
58+
"reference_id": "",
59+
"reference_type": "",
60+
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XXWVZIVAYWEBHNRIILZVB3R3SDQNNAA7/"
61+
}
62+
],
63+
"patches": [],
64+
"severities": [
65+
{
66+
"system": "cvssv3",
67+
"value": "6.5",
68+
"scoring_elements": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L"
69+
}
70+
],
71+
"date_published": "2024-01-29T23:15:00+00:00",
72+
"weaknesses": [],
73+
"url": "https://test.com"
74+
}

0 commit comments

Comments
 (0)