Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/mcp-server-vdb/src/mcp_server_vdb/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ async def handle_call_tool(name: str, arguments: dict[str, Any] | None) -> list[
write_stream,
InitializationOptions(
server_name="appthreat-vulnerability-db",
server_version="6.3.0",
server_version="6.3.1",
capabilities=server.get_capabilities(
notification_options=NotificationOptions(),
experimental_capabilities={},
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "appthreat-vulnerability-db"
version = "6.3.0"
version = "6.3.1"
description = "AppThreat's vulnerability database and package search library with a built-in sqlite based storage. OSV, CVE, GitHub, npm are the primary sources of vulnerabilities."
authors = [
{name = "Team AppThreat", email = "cloud@appthreat.com"},
Expand Down Expand Up @@ -69,3 +69,8 @@ testpaths = [
disable = ["broad-exception-caught", "too-many-branches", "too-many-statements", "too-many-nested-blocks", "too-many-locals", "missing-function-docstring", "too-many-lines", "missing-module-docstring"]
ignore-paths = ["vdb/lib/cve_model/*"]
generated-member = ["orjson.loads", "orjson.dumps", "orjson.OPT_NAIVE_UTC"]

[dependency-groups]
dev = [
"ruff>=0.11.7",
]
1 change: 1 addition & 0 deletions test/data/osv-pypi4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":"GHSA-vqfr-h8mv-ghfj","summary":"h11 accepts some malformed Chunked-Encoding bodies","details":"### Impact\n\nA leniency in h11's parsing of line terminators in chunked-coding message bodies can lead to request smuggling vulnerabilities under certain conditions.\n\n### Details\n\nHTTP/1.1 Chunked-Encoding bodies are formatted as a sequence of \"chunks\", each of which consists of:\n\n- chunk length\n- `\\r\\n`\n- `length` bytes of content\n- `\\r\\n`\n\nIn versions of h11 up to 0.14.0, h11 instead parsed them as:\n\n- chunk length\n- `\\r\\n`\n- `length` bytes of content\n- any two bytes\n\ni.e. it did not validate that the trailing `\\r\\n` bytes were correct, and if you put 2 bytes of garbage there it would be accepted, instead of correctly rejecting the body as malformed.\n\nBy itself this is harmless. However, suppose you have a proxy or reverse-proxy that tries to analyze HTTP requests, and your proxy has a _different_ bug in parsing Chunked-Encoding, acting as if the format is:\n\n- chunk length\n- `\\r\\n`\n- `length` bytes of content\n- more bytes of content, as many as it takes until you find a `\\r\\n`\n\nFor example, [pound](https://github.com/graygnuorg/pound/pull/43) had this bug -- it can happen if an implementer uses a generic \"read until end of line\" helper to consumes the trailing `\\r\\n`.\n\nIn this case, h11 and your proxy may both accept the same stream of bytes, but interpret them differently. For example, consider the following HTTP request(s) (assume all line breaks are `\\r\\n`):\n\n```\nGET /one HTTP/1.1\nHost: localhost\nTransfer-Encoding: chunked\n\n5\nAAAAAXX2\n45\n0\n\nGET /two HTTP/1.1\nHost: localhost\nTransfer-Encoding: chunked\n\n0\n```\n\nHere h11 will interpret it as two requests, one with body `AAAAA45` and one with an empty body, while our hypothetical buggy proxy will interpret it as a single request, with body `AAAAXX20\\r\\n\\r\\nGET /two ...`. And any time two HTTP processors both accept the same string of bytes but interpret them differently, you have the conditions for a \"request smuggling\" attack. For example, if `/two` is a dangerous endpoint and the job of the reverse proxy is to stop requests from getting there, then an attacker could use a bytestream like the above to circumvent this protection.\n\nEven worse, if our buggy reverse proxy receives two requests from different users:\n\n```\nGET /one HTTP/1.1\nHost: localhost\nTransfer-Encoding: chunked\n\n5\nAAAAAXX999\n0\n```\n\n```\nGET /two HTTP/1.1\nHost: localhost\nCookie: SESSION_KEY=abcdef...\n```\n\n...it will consider the first request to be complete and valid, and send both on to the h11-based web server over the same socket. The server will then see the two concatenated requests, and interpret them as _one_ request to `/one` whose body includes `/two`'s session key, potentially allowing one user to steal another's credentials.\n\n### Patches\n\nFixed in h11 0.15.0.\n\n### Workarounds\n\nSince exploitation requires the combination of buggy h11 with a buggy (reverse) proxy, fixing either component is sufficient to mitigate this issue.\n\n### Credits\n\nReported by Jeppe Bonde Weikop on 2025-01-09.","aliases":["CVE-2025-43859"],"modified":"2025-04-24T22:22:25.803917Z","published":"2025-04-24T16:07:56Z","related":["CGA-6568-886h-p4m7","CGA-7qwr-ggrp-xcp2"],"database_specific":{"github_reviewed_at":"2025-04-24T16:07:56Z","github_reviewed":true,"severity":"CRITICAL","cwe_ids":["CWE-444"],"nvd_published_at":"2025-04-24T19:15:47Z"},"references":[{"type":"WEB","url":"https://github.com/python-hyper/h11/security/advisories/GHSA-vqfr-h8mv-ghfj"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-43859"},{"type":"WEB","url":"https://github.com/python-hyper/h11/commit/114803a29ce50116dc47951c690ad4892b1a36ed"},{"type":"PACKAGE","url":"https://github.com/python-hyper/h11"}],"affected":[{"package":{"name":"h11","ecosystem":"PyPI","purl":"pkg:pypi/h11"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.16.0"}]}],"versions":["0.0.1","0.10.0","0.11.0","0.12.0","0.13.0","0.14.0","0.15.0","0.5.0","0.6.0","0.7.0","0.8.0","0.8.1","0.9.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/04/GHSA-vqfr-h8mv-ghfj/GHSA-vqfr-h8mv-ghfj.json"}}],"schema_version":"1.6.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"}]}
40 changes: 31 additions & 9 deletions test/test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,15 @@ def test_osv_pypi3_json():
return json.loads(fp.read())


@pytest.fixture
def test_osv_pypi4_json():
test_cve_data = os.path.join(
os.path.dirname(os.path.realpath(__file__)), "data", "osv-pypi4.json"
)
with open(test_cve_data, mode="r", encoding="utf-8") as fp:
return json.loads(fp.read())


@pytest.fixture
def test_osv_swift_json():
test_cve_data = os.path.join(
Expand Down Expand Up @@ -556,7 +565,7 @@ def test_convert(test_cve_json):
results_count = len(
list(search.search_by_any("cpe:2.3:o:google:android:8.1:*:*:*:*:*:*:*"))
)
assert results_count == 6
assert results_count == 25

cvesource = CVESource()
cve = cvesource.convert5(vulnerabilities)
Expand Down Expand Up @@ -692,7 +701,7 @@ def test_nvd_api_convert(
)
)
)
assert results_count == 1
assert results_count == 2

# git_json
vulnerabilities = nvdlatest.convert(test_nvd_api_git_json)
Expand Down Expand Up @@ -866,12 +875,12 @@ def test_osv_convert(
db6.clear_all()
osvlatest.store(cve_data)
cve_data_count, cve_index_count = db6.stats()
assert cve_data_count == 5
assert cve_index_count == 5
assert cve_data_count == 4
assert cve_index_count == 4
results_count = len(list(search.search_by_any("CVE-2020-8022")))
assert results_count == 0
results_count = len(list(search.search_by_any("CVE-2019-0647")))
assert results_count == 5
assert results_count == 4
results_count = len(
list(search.search_by_any("pkg:maven/org.springframework/spring-web"))
)
Expand All @@ -893,20 +902,20 @@ def test_osv_convert(
db6.clear_all()
osvlatest.store(cve_data)
cve_data_count, cve_index_count = db6.stats()
assert cve_data_count == 4
assert cve_index_count == 4
assert cve_data_count == 3
assert cve_index_count == 3
results_count = len(list(search.search_by_any("CVE-2020-8022")))
assert results_count == 0
results_count = len(list(search.search_by_any("CVE-2019-3192")))
assert results_count == 4
assert results_count == 3
results_count = len(
list(search.search_by_any("pkg:apk/alpine/mariadb?arch=source"))
)
assert results_count == 0
results_count = len(
list(search.search_by_any("pkg:maven/org.springframework/spring-web"))
)
assert results_count == 4
assert results_count == 3

# swift
cve_data = osvlatest.convert(test_osv_swift_json)
Expand Down Expand Up @@ -1057,6 +1066,19 @@ def test_osv_convert(
cve_data = osvlatest.convert(test_osv_pypi3_json)
assert cve_data

def test_osv_pypi4(test_osv_pypi4_json):
osvlatest = OSVSource()
db6.clear_all()
cve_data = osvlatest.convert(test_osv_pypi4_json)
assert cve_data
osvlatest.store(cve_data)
cve_data_count, cve_index_count = db6.stats()
assert cve_data_count == 1
assert cve_index_count == 1
res = search.search_by_any("CVE-2025-43859")
results_count = len(list(res))
assert results_count == 1


def test_osv_convert2(test_osv_npm_star_json):
osvlatest = OSVSource()
Expand Down
Loading