ApacheTomcatImporterPipeline truncates milestone fixed versions (e.g. 11.0.0-M6 -> 11.0.0)
Maintainers usually reply within 5 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- data-engineering
Research direction
Start in vulnerabilities/pipelines/v2_importers/apache_tomcat_importer.py at parse_tomcat_security, where the regex Tomcat\s+([\d\.]+) truncates versions at -. Run the reproduction script from the issue with PYTHONPATH=. DJANGO_SETTINGS_MODULE=vulnerablecode.settings to confirm fixed_in is 11.0.0 instead of 11.0.0-M6. Done means milestone and plain version headings both parse correctly, with tests covering 11.0.0-M6 and an existing release version.
Written by the indexing model from the issue text.
Description
parse_tomcat_security in vulnerabilities/pipelines/v2_importers/apache_tomcat_importer.py extracts the fixed version from headings like "Fixed in Apache Tomcat 11.0.0-M6" with:
re.search(r"Tomcat\s+([\d\.]+)", header.get_text())
[\d\.]+ only matches digits and dots, so it stops at the - and milestone/pre-release fixed versions are truncated: 11.0.0-M6 becomes 11.0.0.
Reproduction
import django
django.setup()
from vulnerabilities.pipelines.v2_importers.apache_tomcat_importer import parse_tomcat_security
HTML = """
<h3 id="Fixed_in_Apache_Tomcat_11.0.0-M6">Fixed in Apache Tomcat 11.0.0-M6</h3>
<div class="text">
<p><strong>Important: Information disclosure</strong>
<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-34981">CVE-2023-34981</a></p>
<p>Affects: 11.0.0-M5</p>
</div>
"""
for advisory in parse_tomcat_security(HTML):
print("fixed_in:", advisory.fixed_in)
Run with PYTHONPATH=. DJANGO_SETTINGS_MODULE=vulnerablecode.settings python repro.py on current main.
Actual: fixed_in: 11.0.0
Expected: fixed_in: 11.0.0-M6
Impact
On https://tomcat.apache.org/security-11.html, 7 "Fixed in" headings use milestone versions (11.0.0-M3, M5, M6, M11, M12, M17, M21). All of them collapse to 11.0.0, which is also a real release heading on the same page. So these advisories get the wrong fixed version, and the fixed-version constraint ends up as !=11.0.0 instead of !=11.0.0-M6.
I noticed this while working on #2528 (PR #2531). I'd like to work on a fix with tests if that's okay.
- Dominant language
- Python
- Stars
- 722
- Forks
- 364
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 3
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aboutcode-org/vulnerablecode
-
`gitlab_importer_v2` pipeline failing due to malformed YAML filePossibly taken @Gowri213 claimed this 1 day ago. Openbug Pipeline: Failure Priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aboutcode-org/vulnerablecode#2523 · 1 comment ·
Maintainers usually reply within 5 days
-
Pipeline run pages return 500 for a schedule whose pipeline is not registeredPossibly taken @sanchit955 claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aboutcode-org/vulnerablecode#2505 ·
Maintainers usually reply within 5 days
-
Affected-by-advisories v2 page returns 500 for a purl with no matching packagePossibly taken @sanchit955 claimed this 9 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
aboutcode-org/vulnerablecode#2501 ·
Maintainers usually reply within 5 days
-
OSV v3 parser shares introduced/fixed commit patches across affected packagesPossibly taken @Celestial-0 claimed this 22 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
aboutcode-org/vulnerablecode#2489 ·
Maintainers usually reply within 5 days
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargoPossibly taken @Ashutosh-Panda2004 claimed this 28 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
aboutcode-org/vulnerablecode#2485 · 1 comment ·
Maintainers usually reply within 5 days
All issues in aboutcode-org/vulnerablecode
Similar issues
-
app: scripts Bucket: KTLO status: backlog type: housekeeping
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
netbox-community/netbox-scripts#217 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
PermafrostDiscoveryGateway/water-timeseries-v2#312 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ClickHouse/dbt-clickhouse#829 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day