aboutcode-org / aboutcode-org/vulnerablecode

Are we identifying all affected Ubuntu packages?

未關閉
#1,095 2 則留言 0 個 reaction 已指派 1 人 已被 @johnmhoran 認領 在 GitHub 檢視
Data collection enhancement
主要語言
Python
星號
702
分支
328
平均合併
3 天 8 小時
30 天內合併 PR
3

描述

While working on the SUSE Oval importer, I've been exploring the Debian and Ubuntu OVAL importers and noticed that in one set of test files, we are reporting `potrace` as an affected package but arguably should also report `libpotrace0` as an affected package.

I think the relevant `oval_parser.py` code is [here](https://github.com/nexB/vulnerablecode/blob/main/vulnerabilities/oval_parser.py#L103-L120). This function searches the `` element for a `var_ref` field and when found uses RegEx to extract the name of a package from the `comment` field.

With the test file [ubuntu_oval_data.xml](https://github.com/nexB/vulnerablecode/blob/main/vulnerabilities/tests/test_data/ubuntu_oval_data.xml), for example, it seems the term `potrace` is extracted from `comment="The 'potrace' package binaries."` on [line 83](https://github.com/nexB/vulnerablecode/blob/main/vulnerabilities/tests/test_data/ubuntu_oval_data.xml#L83).

However, in the `` element [below](https://github.com/nexB/vulnerablecode/blob/main/vulnerabilities/tests/test_data/ubuntu_oval_data.xml#L97-L106), there is not only a similar `comment` field, but two nested `` elements, one with the text `libpotrace0` and the other with the text `potrace`. I suspect that we actually want to report both of these as affected packages, but current report only `potrace` (see [ubuntu-oval-expected.json](https://github.com/nexB/vulnerablecode/blob/main/vulnerabilities/tests/test_data/ubuntu-oval-expected.json#L12)).

BTW, based on minor sampling thus far, it appears that neither Debian nor SUSE includes a `` element in their respective OVAL XML structures.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。