Skip to content

Commit 448c159

Browse files
authored
fix: Improve .NET detection (#4750)
1 parent 9e5dcb5 commit 448c159

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

cve_bin_tool/checkers/dotnet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class DotnetChecker(Checker):
1818
FILENAME_PATTERNS: list[str] = []
1919
VERSION_PATTERNS: list[str] = [
2020
r"dotnet-v([0-9]+\.[0-9]+\.[0-9]{1,2})",
21+
r"/([0-9]+\.[0-9]+\.[0-9]{1,2})\+[0-9a-f]{40}\r?\nMicrosoft\r?\n .NET\r?\n",
2122
]
2223
VENDOR_PRODUCT: list[tuple[str, str]] = [
2324
("microsoft", ".net"),

test/test_data/dotnet.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
"product": ".net",
44
"version": "7.0.11",
55
"version_strings": ["dotnet-v7.0.11"],
6-
}
6+
},
7+
{
8+
"product": ".net",
9+
"version": "8.0.12",
10+
"version_strings": [
11+
"/8.0.12+89ef51c5d8f5239345127a1e282e11036e590c8b\nMicrosoft\n .NET\n"
12+
],
13+
},
714
]
815

916
package_test_data = [
@@ -14,4 +21,10 @@
1421
"package_name": "dotnet-runtime-7.0-7.0.11-1.fc39.aarch64.rpm",
1522
"other_products": ["clang"],
1623
},
24+
{
25+
"url": "http://security.ubuntu.com/ubuntu/pool/main/d/dotnet8/",
26+
"package_name": "dotnet-runtime-8.0_8.0.12-0ubuntu1~24.10.1_amd64.deb",
27+
"product": ".net",
28+
"version": "8.0.12",
29+
},
1730
]

0 commit comments

Comments
 (0)