Migrate Gentoo importer to advisory V2#2090
Migrate Gentoo importer to advisory V2#2090ziadhany wants to merge 9 commits intoaboutcode-org:mainfrom
Conversation
77f89b8 to
7ef7684
Compare
|
gentoo importer V2 logs: gentoo importer V1 logs: |
76f65a8 to
0bed9dd
Compare
4c5830d to
ca3fc16
Compare
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Update the Gentoo get_safe_and_affected_versions function in advisory v2 Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
76c1f80 to
a5e7bd4
Compare
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
keshav-space
left a comment
There was a problem hiding this comment.
@ziadhany Thanks, see some feedback below.
| cves = [] | ||
| summary = "" | ||
| xml_root = ET.parse(file).getroot() | ||
| id = xml_root.attrib.get("id") |
There was a problem hiding this comment.
| id = xml_root.attrib.get("id") | |
| id = xml_root.attrib.get("id", "") |
|
|
||
| affected_package = AffectedPackageV2( | ||
| package=purl, | ||
| affected_version_range=EbuildVersionRange(constraints=[constraint]), |
There was a problem hiding this comment.
It does not make sense to report unaffected range in affected_version_range.
| url=f"https://security.gentoo.org/glsa/{id}" | ||
| if id | ||
| else "https://security.gentoo.org/glsa", |
There was a problem hiding this comment.
This should suffice
| url=f"https://security.gentoo.org/glsa/{id}" | |
| if id | |
| else "https://security.gentoo.org/glsa", | |
| url=f"https://security.gentoo.org/glsa/{id}", |
| if invert: | ||
| constraint = constraint.invert() |
There was a problem hiding this comment.
@ziadhany why do we invert fixed range, we should report fixed range as is.
There was a problem hiding this comment.
@keshav-space we have two type of package version
- unaffected
- vulnerable
GLSA-201405-01 , CVE-2014-0004
<affected>
<package name="sys-fs/udisks" auto="yes" arch="*">
<unaffected range="rge">1.0.5</unaffected>
<unaffected range="ge">2.1.3</unaffected>
<vulnerable range="lt">2.1.3</vulnerable>
</package>
</affected>
we invert the unaffected (safe_version) to get the affected version if it isn’t specified.
see line: 159, 162
the main question is that does the unaffected mean fixed range, if yes I should update this
There was a problem hiding this comment.
the main question is that does the unaffected mean fixed range, if yes I should update this
@ziadhany Yes, unaffected is fixed range see resolution section here https://security.gentoo.org/glsa/201405-01 so if we get unaffected range it should be treated as fixed range.
Also rge means revision greater than equals and rgt means revision greater than lets mention this in comments.
<unaffected range="ge">2.1.3</unaffected> is pretty straight forward it translates to fixed range vers:ebuild/>=2.1.3. But revision range are bit tricky here <unaffected range="rge">1.0.5</unaffected> translates to vers:ebuild/>=1.0.5|<1.1 see the interpretation here https://security.gentoo.org/glsa/201405-01
similarly for this advisory https://security.gentoo.org/glsa/202004-13 we have these unaffected range
<unaffected range="rge">2.23.3</unaffected>
<unaffected range="rge">2.24.3</unaffected>
<unaffected range="rge">2.25.4</unaffected>
<unaffected range="rge">2.26.2</unaffected>and these would be interpreted as fixed range
vers:ebuild/>=2.23.3|<2.24
vers:ebuild/>=2.24.3|<2.25
vers:ebuild/>=2.25.4|<2.26
vers:ebuild/>=2.26.2|<2.27
| { | ||
| "package": { | ||
| "type": "ebuild", | ||
| "namespace": "dev-vcs", | ||
| "name": "subversion", | ||
| "version": "", | ||
| "qualifiers": "", | ||
| "subpath": "" | ||
| }, | ||
| "affected_version_range": "vers:ebuild/<=1.8.18", | ||
| "fixed_version_range": null, | ||
| "introduced_by_commit_patches": [], | ||
| "fixed_by_commit_patches": [] | ||
| } |
There was a problem hiding this comment.
Not right, for the unaffected range <unaffected range="ge">1.9.7</unaffected> and <unaffected range="rgt">1.8.18</unaffected> we should report vers:ebuild/>1.8.18 and vers:ebuild/1.9.7 as fixed version range and do not invert these and report it as affected vers.
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Issue: