ApacheTomcatImporterPipeline truncates milestone fixed versions (e.g. 11.0.0-M6 -> 11.0.0)

Open Beginner friendly
#2,533 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

@nikolya-ctrl is already working on this.

Since Nov 25, 2026.

  • #2534 by @nikolya-ctrl — open

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

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aboutcode-org/vulnerablecode

All issues in aboutcode-org/vulnerablecode

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.