diff --git a/vulnerabilities/importers/__init__.py b/vulnerabilities/importers/__init__.py index 13b6e12c7..d0c473ea5 100644 --- a/vulnerabilities/importers/__init__.py +++ b/vulnerabilities/importers/__init__.py @@ -9,6 +9,7 @@ from vulnerabilities.importers import alpine_linux from vulnerabilities.importers import apache_httpd +from vulnerabilities.importers import apache_tomcat from vulnerabilities.importers import archlinux from vulnerabilities.importers import debian from vulnerabilities.importers import debian_oval @@ -55,6 +56,7 @@ project_kb_msr2019.ProjectKBMSRImporter, suse_scores.SUSESeverityScoreImporter, elixir_security.ElixirSecurityImporter, + apache_tomcat.ApacheTomcatImporter, ] IMPORTERS_REGISTRY = {x.qualified_name: x for x in IMPORTERS_REGISTRY} diff --git a/vulnerabilities/importers/apache_tomcat.py b/vulnerabilities/importers/apache_tomcat.py index 99cb8ce67..3d754d6df 100644 --- a/vulnerabilities/importers/apache_tomcat.py +++ b/vulnerabilities/importers/apache_tomcat.py @@ -7,135 +7,519 @@ # See https://aboutcode.org for more information about nexB OSS projects. # -import asyncio -import re +import dataclasses +import logging +import urllib +from collections import namedtuple import requests from bs4 import BeautifulSoup from packageurl import PackageURL +from univers.version_constraint import VersionConstraint +from univers.version_range import ApacheVersionRange from univers.version_range import MavenVersionRange from univers.versions import MavenVersion from univers.versions import SemverVersion from vulnerabilities.importer import AdvisoryData +from vulnerabilities.importer import AffectedPackage from vulnerabilities.importer import Importer from vulnerabilities.importer import Reference -from vulnerabilities.package_managers import MavenVersionAPI -from vulnerabilities.utils import create_etag -from vulnerabilities.utils import nearest_patched_package +from vulnerabilities.importer import VulnerabilitySeverity +from vulnerabilities.severity_systems import APACHE_TOMCAT + +LOGGER = logging.getLogger(__name__) + +corrective_data_mapping = { + ("not released Fixed in Apache Tomcat 9.0.9", "CVE-2018-8014"): { + "fixed_versions": ["9.0.9"], + "affected_versions": ["9.0.0.M1 to 9.0.8"], + }, + ("6 July 2018 Fixed in Apache Tomcat 8.0.53", "CVE-2018-8014"): { + "fixed_versions": ["8.0.53"], + "affected_versions": ["8.0.0.RC1 to 8.0.52"], + }, + ("26 June 2018 Fixed in Apache Tomcat 8.5.32", "CVE-2018-8014"): { + "fixed_versions": ["8.5.32"], + "affected_versions": ["8.5.0 to 8.5.31"], + }, + ("not released Fixed in Apache Tomcat 7.0.89", "CVE-2018-8014"): { + "fixed_versions": ["7.0.89"], + "affected_versions": ["7.0.41 to 7.0.88"], + }, + ("16 May 2018 Fixed in Apache Tomcat 7.0.88", "CVE-2018-1336"): { + "fixed_versions": ["7.0.88"], + "affected_versions": ["7.0.28 to 7.0.86"], + }, + ("released 21 Jan 2010 Fixed in Apache Tomcat 6.0.24", "CVE-2009-2901"): { + "fixed_versions": ["6.0.24"], + "affected_versions": ["6.0.0-6.0.20"], + }, + ("released 20 Apr 2010 Fixed in Apache Tomcat 5.5.29", "CVE-2009-2901"): { + "fixed_versions": ["5.5.29"], + "affected_versions": ["5.5.0-5.5.28"], + }, + ("released 4 Sep 2009 Fixed in Apache Tomcat 5.5.28", "CVE-2009-0580"): { + "fixed_versions": ["5.5.28"], + "affected_versions": ["5.5.0-5.5.27"], + }, + ("not released Fixed in Apache Tomcat 5.5.21", "CVE-2008-4308"): { + "fixed_versions": ["5.5.21"], + "affected_versions": ["5.5.10-5.5.20"], + }, + ("Fixed in Apache Tomcat 5.5.1", "CVE-2008-3271"): { + "fixed_versions": ["5.5.1"], + "affected_versions": ["5.5.0"], + }, + ("Will not be fixed in Apache Tomcat 4.1.x", "CVE-2005-4836"): { + "fixed_versions": [], + "affected_versions": ["4.1.15-4.1.SVN"], + }, + ("Fixed in Apache Tomcat 4.1.40", "CVE-2009-0580"): { + "fixed_versions": ["4.1.40"], + "affected_versions": ["4.1.0-4.1.39"], + }, + ("Fixed in Apache Tomcat 4.1.35", "CVE-2008-4308"): { + "fixed_versions": ["4.1.35"], + "affected_versions": ["4.1.32-4.1.34"], + }, + ("Fixed in Apache Tomcat 4.1.3", "CVE-2002-0935"): { + "fixed_versions": ["4.1.3"], + "affected_versions": ["4.0.0-4.0.2", "4.0.3", "4.0.4-4.0.6", "4.1.0-4.1.2"], + }, + ("Fixed in Apache Tomcat 4.0.0", "CVE-2002-0493"): { + "fixed_versions": ["4.0.0"], + "affected_versions": ["<4.0.0"], + }, + ("Not fixed in Apache Tomcat 3.x", "CVE-2005-0808"): { + "fixed_versions": [], + "affected_versions": ["3.0", "3.1-3.1.1", "3.2-3.2.4", "3.3a-3.3.2"], + }, + ("Not fixed in Apache Tomcat 3.x", "CVE-2007-3382"): { + "fixed_versions": [], + "affected_versions": ["3.3-3.3.2"], + }, + ("Not fixed in Apache Tomcat 3.x", "CVE-2007-3384"): { + "fixed_versions": [], + "affected_versions": ["3.3-3.3.2"], + }, + ("Not fixed in Apache Tomcat 3.x", "CVE-2007-3385"): { + "fixed_versions": [], + "affected_versions": ["3.3-3.3.2"], + }, + ("Fixed in Apache Tomcat 3.2.4", "CVE-2001-1563"): { + "fixed_versions": ["3.2.4"], + "affected_versions": ["3.2", "3.2.1", "3.2.2-3.2.3"], + }, +} class ApacheTomcatImporter(Importer): - base_url = "https://tomcat.apache.org/security-{}" + spdx_license_expression = "Apache-2.0" + license_url = "https://www.apache.org/licenses/LICENSE-2.0" - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.version_api = MavenVersionAPI() - asyncio.run(self.version_api.load_api({"org.apache.tomcat:tomcat"})) + def fetch_advisory_pages(self): + """ + Yield the content of each HTML page containing version-related security data. + """ + links = self.fetch_advisory_links("https://tomcat.apache.org/security") + for page_url in links: + yield requests.get(page_url).content - def updated_advisories(self): - advisories = [] - for advisory_page in self.fetch_pages(): - advisories.extend(self.to_advisories(advisory_page)) - return self.batch_advisories(advisories) - - def fetch_pages(self): - # Here Semver is used because it has notion of major, minor versions. - tomcat_major_versions = { - SemverVersion(i).value.major - for i in self.version_api.get("org.apache.tomcat:tomcat").valid_versions - } - for version in tomcat_major_versions: - page_url = self.base_url.format(version) - if create_etag(self, page_url, "ETag"): - yield requests.get(page_url).content + def fetch_advisory_links(self, url): + """ + Yield the URLs of each Tomcat version security-related page. + Each page link is in the form of `https://tomcat.apache.org/security-10.html`, + for instance, for v10. + """ + data = requests.get(url).content + soup = BeautifulSoup(data, features="lxml") + for tag in soup.find_all("a"): + link = tag.get("href") + + if "security-" in link and any(char.isdigit() for char in link): + yield urllib.parse.urljoin(url, link) - def to_advisories(self, apache_tomcat_advisory_html): + def advisory_data(self): + """ + Return a list of AdvisoryData objects. + """ advisories = [] - page_soup = BeautifulSoup(apache_tomcat_advisory_html, features="lxml") - pageh3s = page_soup.find_all("h3") - vuln_headings = [i for i in pageh3s if "Fixed in Apache Tomcat" in i.text] - for data in vuln_headings: - fixed_version = data.text.split("Fixed in Apache Tomcat")[-1].strip() - details_div = data.find_next_sibling() - - for anchor_tag in details_div.find_all("a"): - if "cve.mitre.org" not in anchor_tag["href"]: - continue - - cve_id = re.search(r"CVE-\d*-\d*", anchor_tag.text).group() - references = [] - affected_packages = [] - paragraph = anchor_tag.find_parent() - - while paragraph and "Affects:" not in paragraph.text: - for ref in paragraph.find_all("a"): - references.append(Reference(url=ref["href"])) - - paragraph = paragraph.find_next_sibling() - - if not paragraph: - # At the end of details_div - continue - - for version_range in parse_version_ranges(paragraph.text): - affected_packages.extend( - [ - PackageURL( - type="maven", namespace="apache", name="tomcat", version=version - ) - for version in self.version_api.get( - "org.apache.tomcat:tomcat" - ).valid_versions - if MavenVersion(version) in version_range - ] - ) - - fixed_package = [ - PackageURL( - type="maven", namespace="apache", name="tomcat", version=fixed_version - ) - ] - advisories.append( - AdvisoryData( - summary="", - affected_packages=nearest_patched_package(affected_packages, fixed_package), - vulnerability_id=cve_id, - references=references, - ) - ) + for advisory_page in self.fetch_advisory_pages(): + advisories.extend(self.extract_advisories_from_page(advisory_page)) return advisories + def extract_advisories_from_page(self, apache_tomcat_advisory_html): + """ + Yield AdvisoryData objects extracted from the HTML text ``apache_tomcat_advisory_html``. + """ + # This yields groups of advisories organized by Tomcat fixed versions -- 1+ per group. + fixed_version_advisory_groups = extract_tomcat_advisory_data_from_page( + apache_tomcat_advisory_html + ) + + for advisory_group in fixed_version_advisory_groups: + yield from generate_advisory_data_objects(advisory_group) + -def parse_version_ranges(string): +@dataclasses.dataclass(order=True) +class TomcatAdvisoryData: + fixed_versions: list + advisory_groups: list + # Use this as the 1st key in `corrective_data_mapping` dictionary. + fixed_version_heading_text: str + + def to_dict(self): + advisory_groups_to_strings = [] + # Convert bs4 para to string. + for group in self.advisory_groups: + advisory_groups_to_strings.append([str(para) for para in group]) + return { + "fixed_versions": self.fixed_versions, + "advisory_groups": advisory_groups_to_strings, + } + + +def extract_tomcat_advisory_data_from_page(apache_tomcat_advisory_html): """ - This method yields VersionRange objects obtained by - parsing `string`. - >>> list(parse_version_ranges("Affects: 9.0.0.M1 to 9.0.0.M9")) == [ - ... VersionRange.from_scheme_version_spec_string('maven','<=9.0.0.M9,>=9.0.0.M1') - ... ] - True - >>> list(parse_version_ranges("Affects: 9.0.0.M1")) == [ - ... VersionRange.from_scheme_version_spec_string('maven','>=9.0.0.M1,<=9.0.0.M1') - ... ] - True - >>> list(parse_version_ranges("Affects: 9.0.0.M1 to 9.0.0.M9, 1.2.3 to 3.4.5")) == [ - ... VersionRange.from_scheme_version_spec_string('maven','<=9.0.0.M9,>=9.0.0.M1'), - ... VersionRange.from_scheme_version_spec_string('maven','<=3.4.5,>=1.2.3') - ... ] - True + Yield TomcatAdvisoryData from the HTML text ``apache_tomcat_advisory_html``. """ - version_rng_txt = string.split("Affects:")[-1].strip() - version_ranges = version_rng_txt.split(",") - for version_range in version_ranges: - if "to" in version_range: - lower_bound, upper_bound = version_range.split("to") - elif "-" in version_range and not any([i.isalpha() for i in version_range]): - lower_bound, upper_bound = version_range.split("-") + page_soup = BeautifulSoup(apache_tomcat_advisory_html, features="lxml") + # We're looking for headers -- one for each advisory -- like this: + #

2022-10-10 Fixed in Apache Tomcat 10.0.27

+ pageh3s = page_soup.find_all("h3") + + # Include the 2 groups of not-fixed advisories. + fixed_header_substrings = ( + "Fixed in Apache Tomcat", + "Will not be fixed in Apache Tomcat 4.1.x", + "Not fixed in Apache Tomcat 3.x", + ) + fixed_version_headings = [ + heading + for heading in pageh3s + if any( + fixed_header_substring in heading.text + for fixed_header_substring in fixed_header_substrings + ) + ] + + for fixed_version_heading in fixed_version_headings: + fixed_versions = [] + fixed_version = "" + + # Include the 2 groups of not-fixed advisories. We report no value for those that won't be fixed. + if "Fixed in Apache Tomcat" in fixed_version_heading.text: + fixed_version = fixed_version_heading.text.split("Fixed in Apache Tomcat")[-1].strip() + elif "Will not be fixed in Apache Tomcat 4.1.x" in fixed_version_heading.text: + fixed_version = fixed_version_heading.text.split("Will not be fixed in Apache Tomcat")[ + -1 + ].strip() + elif "Not fixed in Apache Tomcat 3.x" in fixed_version_heading.text: + fixed_version = fixed_version_heading.text.split("Not fixed in Apache Tomcat")[ + -1 + ].strip() + + # We want to handle the occasional "and" in the fixed version headers, e.g., + #

5 September 2016 Fixed in Apache Tomcat 8.5.5 and 8.0.37

+ if " and " in fixed_version: + fixed_versions = fixed_version.split(" and ") + else: + fixed_versions.append(fixed_version) + + # Each group of fixed-version-related data is contained in a div that immediately follows the h3 element, e.g., + #

8 November 2016 Fixed in Apache Tomcat 8.5.8

+ #
...
+ fixed_version_paras = fixed_version_heading.find_next_sibling() + + # See https://tomcat.apache.org/security-impact.html for scoring. + # Each advisory section starts with a

element, + # the text of which starts with, e.g., "Low:", so we look for these here, e.g., + #

Low: Apache Tomcat request smugglingCVE-2022-42252

+ + severity_scores = ("Low:", "Moderate:", "Important:", "High:", "Critical:") + # A list of groups of paragraphs, each for a single Tomcat Advisory. + advisory_groups = [] + + for para in fixed_version_paras.find_all("p"): + current_group = [] + if para.text.startswith(severity_scores): + current_group.append(para) + + test_next_siblings = para.find_next_siblings() + for next_sibling in test_next_siblings: + if not next_sibling.text.startswith(severity_scores): + current_group.append(next_sibling) + elif next_sibling.text.startswith(severity_scores): + break + + advisory_groups.append(current_group) + + yield TomcatAdvisoryData( + fixed_versions=fixed_versions, + advisory_groups=advisory_groups, + fixed_version_heading_text=fixed_version_heading.text, + ) + + +def generate_advisory_data_objects(tomcat_advisory_data_object): + fixed_versions = tomcat_advisory_data_object.fixed_versions + severity_scores = ("Low:", "Moderate:", "Important:", "High:", "Critical:") + + for para_list in tomcat_advisory_data_object.advisory_groups: + affected_versions = [] + fixed_commit_list = [] + references = [] + cve_url_list = [] + for para in para_list: + if para.text.startswith("Affects:"): + formatted_affected_version_data = para.text.split(":")[-1].split(", ") + affected_versions.extend(formatted_affected_version_data) + elif "was fixed in" in para.text or "was fixed with" in para.text: + fixed_commit_list = para.find_all("a") + references.extend([ref_url["href"] for ref_url in fixed_commit_list]) + elif para.text.startswith(severity_scores): + cve_url_list = para.find_all("a") + cve_list = [cve_url.text for cve_url in cve_url_list] + severity_score = para.text.split(":")[0] + + for cve_url in cve_url_list: + aliases = [] + aliases.append(cve_url.text) + + severity_list = [] + severity_list.append( + VulnerabilitySeverity( + system=APACHE_TOMCAT, + value=severity_score, + scoring_elements="", + ) + ) + + # This is the 1st `corrective_data_mapping` key: + fixed_version_heading_text = tomcat_advisory_data_object.fixed_version_heading_text + + if (fixed_version_heading_text, cve_url.text) in corrective_data_mapping.keys(): + fixed_versions = corrective_data_mapping[fixed_version_heading_text, cve_url.text][ + "fixed_versions" + ] + affected_versions = corrective_data_mapping[ + fixed_version_heading_text, cve_url.text + ]["affected_versions"] + else: + pass + + affected_version_range_apache = to_version_ranges_apache( + affected_versions, + fixed_versions, + ) + + affected_version_range_maven = to_version_ranges_maven( + affected_versions, + fixed_versions, + ) + + references = [ + Reference( + url=f"https://cve.mitre.org/cgi-bin/cvename.cgi?name={cve_url.text}", + reference_id=cve_url.text, + severities=severity_list, + ), + ] + + for commit_url in fixed_commit_list: + references.append(Reference(url=commit_url["href"])) + + affected_packages = [] + + affected_packages.append( + AffectedPackage( + package=PackageURL( + type="apache", + name="tomcat", + ), + affected_version_range=affected_version_range_apache, + ) + ) + + affected_packages.append( + AffectedPackage( + package=PackageURL( + type="maven", + namespace="org.apache.tomcat", + name="tomcat", + ), + affected_version_range=affected_version_range_maven, + ) + ) + + yield AdvisoryData( + aliases=aliases, + summary="", + affected_packages=affected_packages, + references=references, + ) + + +def to_version_ranges_apache(versions_data, fixed_versions): + constraints = [] + + VersionConstraintTuple = namedtuple("VersionConstraintTuple", ["comparator", "version"]) + affected_constraint_tuple_list = [] + fixed_constraint_tuple_list = [] + + for version_item in versions_data: + version_item = version_item.strip() + if "to" in version_item: + version_item_split = version_item.split(" ") + affected_constraint_tuple_list.append( + VersionConstraintTuple(">=", version_item_split[0]) + ) + affected_constraint_tuple_list.append( + VersionConstraintTuple("<=", version_item_split[-1]) + ) + + elif "-" in version_item: + version_item_split = version_item.split("-") + affected_constraint_tuple_list.append( + VersionConstraintTuple(">=", version_item_split[0]) + ) + affected_constraint_tuple_list.append( + VersionConstraintTuple("<=", version_item_split[-1]) + ) + + elif version_item.startswith("<"): + version_item_split = version_item.split("<") + affected_constraint_tuple_list.append( + VersionConstraintTuple("<", version_item_split[-1]) + ) + else: - lower_bound = upper_bound = version_range + version_item_split = version_item.split(" ") + affected_constraint_tuple_list.append( + VersionConstraintTuple("=", version_item_split[0]) + ) + + for fixed_item in fixed_versions: + + if "-" in fixed_item and not any([i.isalpha() for i in fixed_item]): + fixed_item_split = fixed_item.split(" ") + fixed_constraint_tuple_list.append(VersionConstraintTuple(">=", fixed_item_split[0])) + fixed_constraint_tuple_list.append(VersionConstraintTuple("<=", fixed_item_split[-1])) + + else: + fixed_item_split = fixed_item.split(" ") + fixed_constraint_tuple_list.append(VersionConstraintTuple("=", fixed_item_split[0])) + + for record in affected_constraint_tuple_list: + try: + constraints.append( + VersionConstraint( + comparator=record.comparator, + version=SemverVersion(record.version), + ) + ) + except Exception as e: + LOGGER.error(f"{record.version!r} is not a valid SemverVersion {e!r}") + continue + + for record in fixed_constraint_tuple_list: + constraints.append( + VersionConstraint( + comparator=record.comparator, + version=SemverVersion(record.version), + ).invert() + ) + + return ApacheVersionRange(constraints=constraints) + + +def to_version_ranges_maven(versions_data, fixed_versions): + constraints = [] + + for version_item in versions_data: + version_item = version_item.strip() + if "to" in version_item: + version_item_split = version_item.split(" ") + + constraints.append( + VersionConstraint( + comparator=">=", + version=MavenVersion(version_item_split[0]), + ) + ) + constraints.append( + VersionConstraint( + comparator="<=", + version=MavenVersion(version_item_split[-1]), + ) + ) + + elif "-" in version_item: + version_item_split = version_item.split("-") + + constraints.append( + VersionConstraint( + comparator=">=", + version=MavenVersion(version_item_split[0]), + ) + ) + constraints.append( + VersionConstraint( + comparator="<=", + version=MavenVersion(version_item_split[-1]), + ) + ) + + elif version_item.startswith("<"): + version_item_split = version_item.split("<") + + constraints.append( + VersionConstraint( + comparator="<", + version=MavenVersion(version_item_split[-1]), + ) + ) + + else: + version_item_split = version_item.split(" ") + + constraints.append( + VersionConstraint( + comparator="=", + version=MavenVersion(version_item_split[0]), + ) + ) + + for fixed_item in fixed_versions: + + if "-" in fixed_item and not any([i.isalpha() for i in fixed_item]): + fixed_item_split = fixed_item.split(" ") + + constraints.append( + VersionConstraint( + comparator=">=", + version=MavenVersion(fixed_item_split[0]), + ).invert() + ) + constraints.append( + VersionConstraint( + comparator="<=", + version=MavenVersion(fixed_item_split[-1]), + ).invert() + ) + + else: + fixed_item_split = fixed_item.split(" ") + + constraints.append( + VersionConstraint( + comparator="=", + version=MavenVersion(fixed_item_split[0]), + ).invert() + ) - yield MavenVersionRange.from_native(f">={lower_bound},<={upper_bound}") + return MavenVersionRange(constraints=constraints) diff --git a/vulnerabilities/severity_systems.py b/vulnerabilities/severity_systems.py index 2bf27de98..de0d45f69 100644 --- a/vulnerabilities/severity_systems.py +++ b/vulnerabilities/severity_systems.py @@ -124,6 +124,27 @@ def compute(self, scoring_elements: str) -> str: name="Apache Httpd Severity", url="https://httpd.apache.org/security/impact_levels.html", ) +APACHE_HTTPD.choices = [ + "Critical", + "Important", + "Moderate", + "Low", +] + +# This is essentially identical to apache_http except for the addition of the "High" score, +# which seems to be used interchangeably for "Important". +APACHE_TOMCAT = ScoringSystem( + identifier="apache_tomcat", + name="Apache Tomcat Severity", + url="https://tomcat.apache.org/security-impact.html", +) +APACHE_TOMCAT.choices = [ + "Critical", + "High", + "Important", + "Moderate", + "Low", +] SCORING_SYSTEMS = { system.identifier: system @@ -137,5 +158,6 @@ def compute(self, scoring_elements: str) -> str: CVSS31_QUALITY, GENERIC, APACHE_HTTPD, + APACHE_TOMCAT, ) } diff --git a/vulnerabilities/tests/conftest.py b/vulnerabilities/tests/conftest.py index 8ee0affda..c692c2a80 100644 --- a/vulnerabilities/tests/conftest.py +++ b/vulnerabilities/tests/conftest.py @@ -26,7 +26,6 @@ def no_rmtree(monkeypatch): # Step 3: Migrate all the tests collect_ignore = [ "test_apache_kafka.py", - "test_apache_tomcat.py", "test_api.py", "test_models.py", "test_package_managers.py", diff --git a/vulnerabilities/tests/test_apache_tomcat.py b/vulnerabilities/tests/test_apache_tomcat.py index 1e7bb34b1..4c5033e14 100644 --- a/vulnerabilities/tests/test_apache_tomcat.py +++ b/vulnerabilities/tests/test_apache_tomcat.py @@ -9,216 +9,382 @@ import os from unittest import TestCase -from unittest.mock import patch -from packageurl import PackageURL +from univers.version_constraint import VersionConstraint +from univers.version_range import ApacheVersionRange +from univers.version_range import MavenVersionRange +from univers.versions import MavenVersion +from univers.versions import SemverVersion -from vulnerabilities.importer import AdvisoryData -from vulnerabilities.importer import Reference from vulnerabilities.importers.apache_tomcat import ApacheTomcatImporter -from vulnerabilities.package_managers import MavenVersionAPI -from vulnerabilities.package_managers import PackageVersion -from vulnerabilities.utils import AffectedPackage +from vulnerabilities.importers.apache_tomcat import extract_tomcat_advisory_data_from_page +from vulnerabilities.importers.apache_tomcat import to_version_ranges_apache +from vulnerabilities.importers.apache_tomcat import to_version_ranges_maven +from vulnerabilities.tests import util_tests BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -TEST_DATA = os.path.join(BASE_DIR, "test_data", "apache_tomcat", "security-9.html") - - -class TestApacheTomcatImporter(TestCase): - @classmethod - def setUpClass(cls): - data_source_cfg = {"etags": {}} - mock_api = MavenVersionAPI( - cache={ - "org.apache.tomcat:tomcat": [ - PackageVersion("9.0.0.M1"), - PackageVersion("9.0.0.M2"), - PackageVersion("8.0.0.M1"), - PackageVersion("6.0.0M2"), +TEST_DATA = os.path.join(BASE_DIR, "test_data/apache_tomcat") + + +def test_method_extract_advisories_from_page(): + with open(os.path.join(TEST_DATA, "apache_tomcat-selected-advisories.html")) as f: + raw_data = f.read() + extracted_advisories = ApacheTomcatImporter().extract_advisories_from_page(raw_data) + + results = [adv.to_dict() for adv in extracted_advisories] + + expected_file = os.path.join( + TEST_DATA, f"parse-apache_tomcat-selected-advisories-expected.json" + ) + util_tests.check_results_against_json(results, expected_file) + + +def test_extract_advisories_from_page(): + page = """ +

6 April 2021 Fixed in Apache Tomcat 10.0.5

+ +

Important: Denial of Service + CVE-2021-30639

+ +

An error introduced as part of a change to improve error handling.

+ Applications that do not use non-blocking I/O are not exposed to this vulnerability. + +

This was fixed with commit + b59099e4.

+ +

This issue was reported publicly as 65203.

+ +

Affects: 10.0.3 to 10.0.4

+ +
+ """ + + expected = [ + { + "advisory_groups": [ + [ + "

Important: Denial of Service\n" + "CVE-2021-30639

', + "

An error introduced as part of a change to improve " "error handling.

", + "Applications that do not use non-blocking I/O are " + "not exposed to this vulnerability.", + "

This was fixed with commit\n" + " b59099e4.

', + "

This issue was reported publicly as 65203.

', + "

Affects: 10.0.3 to 10.0.4

", ] - } - ) - with patch("vulnerabilities.importers.apache_tomcat.MavenVersionAPI"): - with patch("vulnerabilities.importers.apache_tomcat.asyncio"): - cls.data_src = ApacheTomcatImporter(1, config=data_source_cfg) - cls.data_src.version_api = mock_api - - def test_to_advisories(self): - expected_advisories = [ - AdvisoryData( - summary="", - vulnerability_id="CVE-2015-5351", - affected_packages=[ - AffectedPackage( - vulnerable_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="8.0.0.M1", - qualifiers={}, - subpath=None, - ), - patched_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M3", - qualifiers={}, - subpath=None, - ), - ), - AffectedPackage( - vulnerable_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M1", - ), - patched_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M3", - ), - ), - AffectedPackage( - vulnerable_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M2", - ), - patched_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M3", - ), - ), - ], - references=[ - Reference( - reference_id="", - url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-5351", - severities=[], - ), - Reference( - reference_id="", - url="https://svn.apache.org/viewvc?view=rev&rev=1720652", - severities=[], - ), - Reference( - reference_id="", - url="https://svn.apache.org/viewvc?view=rev&rev=1720655", - severities=[], - ), - ], - ), - AdvisoryData( - summary="", - vulnerability_id="CVE-2016-0706", - affected_packages=[ - AffectedPackage( - vulnerable_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M1", - ), - patched_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M3", - ), - ) - ], - references=[ - Reference( - reference_id="", - url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0706", - severities=[], - ), - Reference( - reference_id="", - url="https://svn.apache.org/viewvc?view=rev&rev=1722799", - severities=[], - ), + ], + "fixed_versions": ["10.0.5"], + }, + ] + results = extract_tomcat_advisory_data_from_page(page) + results = [d.to_dict() for d in results] + assert results == expected + + +def test_extract_advisories_from_page_with_multiple_groups(): + page = """ +

2 February 2021 Fixed in Apache Tomcat 10.0.2

+ +

Note: The issues below were fixed in Apache Tomcat 10.0.1 but the + release vote for the 10.0.1 release candidate did not pass. Therefore, + although users must download 10.0.2 to obtain a version that includes a + fix for these issues, version 10.0.1 is not included in the list of + affected versions.

+ +

Low: Fix for CVE-2020-9484 was incomplete + CVE-2021-25329

+ +

The fix for CVE-2020-9484 was incomplete. When using a + highly unlikely configuration edge case, the Tomcat instance was still + vulnerable to CVE-2020-9484. Note that both the previously + published prerequisites for CVE-2020-9484 and the previously + published non-upgrade mitigations for CVE-2020-9484 also apply to + this issue.

+ +

This was fixed with commit + 6d66e99e.

+ +

This issue was reported to the Apache Tomcat Security team by Trung Pham + of Viettel Cyber Security on 12 January 2021. The issue was made public + on 1 March 2021.

+ +

Affects: 10.0.0-M1 to 10.0.0

+ +

Important: Request mix-up with h2c + CVE-2021-25122

+ +

When responding to new h2c connection requests, Apache Tomcat could + duplicate request headers and a limited amount of request body from one + request to another meaning user A and user B could both see the results of + user A's request.

+ +

This was fixed with commit + dd757c0a.

+ +

This issue was identified by the Apache Tomcat Security team on 11 + January 2021. The issue was made public on 1 March 2021.

+ +

Affects: 10.0.0-M1 to 10.0.0

+ +

17 November 2020 Fixed in Apache Tomcat 10.0.0-M10

+ +

Important: Information disclosure + CVE-2021-24122

+ +

When serving resources from a network location using the NTFS file system + it was possible to bypass security constraints and/or view the source + code for JSPs in some configurations. The root cause was the unexpected + behaviour of the JRE API File.getCanonicalPath() which in + turn was caused by the inconsistent behaviour of the Windows API + (FindFirstFileW) in some circumstances. +

+ +

This was fixed with commit + 7f004ac4.

+ +

This issue was reported the Apache Tomcat Security team by Ilja Brander + on 26 October 2020. The issue was made public on 14 January 2021.

+ +

Affects: 10.0.0-M1 to 10.0.0-M9

+ +

Moderate: HTTP/2 request header mix-up + CVE-2020-17527

+ +

While investigating issue 64830 it was discovered that Apache + Tomcat could re-use an HTTP request header value from the previous stream + received on an HTTP/2 connection for the request associated with the + subsequent stream. While this would most likely lead to an error and the + closure of the HTTP/2 connection, it is possible that information could + leak between requests. +

+ +

This was fixed with commit + 8d2fe689.

+ +

This issue was identified by the Apache Tomcat Security team on 10 + November 2020. The issue was made public on 3 December 2020.

+ +

Affects: 10.0.0-M1 to 10.0.0-M9

+ +
+ """ + + expected = [ + { + "advisory_groups": [ + [ + "

Low: Fix for CVE-2020-9484 was ' + "incomplete\n" + "CVE-2021-25329

', + "

The fix for CVE-2020-9484 was incomplete. When ' + "using a\n" + " highly unlikely configuration edge case, the " + "Tomcat instance was still\n" + " vulnerable to CVE-2020-9484. Note that both the ' + "previously\n" + " published prerequisites for CVE-2020-9484 and the previously\n' + " published non-upgrade mitigations for CVE-2020-9484 also apply to\n' + " this issue.

", + "

This was fixed with commit\n" + " 6d66e99e.

', + "

This issue was reported to the Apache Tomcat " + "Security team by Trung Pham\n" + " of Viettel Cyber Security on 12 January 2021. " + "The issue was made public\n" + " on 1 March 2021.

", + "

Affects: 10.0.0-M1 to 10.0.0

", ], - ), - AdvisoryData( - summary="", - vulnerability_id="CVE-2016-0714", - affected_packages={}, - references=[ - Reference( - reference_id="", - url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0714", - severities=[], - ), - Reference( - reference_id="", - url="https://svn.apache.org/viewvc?view=rev&rev=1725263", - severities=[], - ), - Reference( - reference_id="", - url="https://svn.apache.org/viewvc?view=rev&rev=1725914", - severities=[], - ), + [ + "

Important: Request mix-up with " + "h2c\n" + "CVE-2021-25122

', + "

When responding to new h2c connection requests, " + "Apache Tomcat could\n" + " duplicate request headers and a limited amount of " + "request body from one\n" + " request to another meaning user A and user B could " + "both see the results of\n" + " user A's request.

", + "

This was fixed with commit\n" + " dd757c0a.

', + "

This issue was identified by the Apache Tomcat " + "Security team on 11\n" + " January 2021. The issue was made public on 1 " + "March 2021.

", + "

Affects: 10.0.0-M1 to 10.0.0

", ], - ), - AdvisoryData( - summary="", - vulnerability_id="CVE-2016-0763", - affected_packages=[ - AffectedPackage( - vulnerable_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M1", - ), - patched_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M3", - ), - ), - AffectedPackage( - vulnerable_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M2", - ), - patched_package=PackageURL( - type="maven", - namespace="apache", - name="tomcat", - version="9.0.0.M3", - ), - ), + ], + "fixed_versions": ["10.0.2"], + }, + { + "advisory_groups": [ + [ + "

Important: Information disclosure\n" + "CVE-2021-24122

', + "

When serving resources from a network location " + "using the NTFS file system\n" + " it was possible to bypass security constraints " + "and/or view the source\n" + " code for JSPs in some configurations. The root " + "cause was the unexpected\n" + " behaviour of the JRE API " + "File.getCanonicalPath() which in\n" + " turn was caused by the inconsistent behaviour " + "of the Windows API\n" + " (FindFirstFileW) in some " + "circumstances.\n" + "

", + "

This was fixed with commit\n" + " 7f004ac4.

', + "

This issue was reported the Apache Tomcat Security " + "team by Ilja Brander\n" + " on 26 October 2020. The issue was made public " + "on 14 January 2021.

", + "

Affects: 10.0.0-M1 to 10.0.0-M9

", ], - references=[ - Reference( - reference_id="", - url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0763", - severities=[], - ), - Reference( - reference_id="", - url="https://svn.apache.org/viewvc?view=rev&rev=1725926", - severities=[], - ), + [ + "

Moderate: HTTP/2 request header " + "mix-up\n" + "CVE-2020-17527

', + "

While investigating issue 64830 ' + "it was discovered that Apache\n" + " Tomcat could re-use an HTTP request header " + "value from the previous stream\n" + " received on an HTTP/2 connection for the " + "request associated with the\n" + " subsequent stream. While this would most likely " + "lead to an error and the\n" + " closure of the HTTP/2 connection, it is " + "possible that information could\n" + " leak between requests.\n" + "

", + "

This was fixed with commit\n" + " 8d2fe689.

', + "

This issue was identified by the Apache Tomcat " + "Security team on 10\n" + " November 2020. The issue was made public on 3 " + "December 2020.

", + "

Affects: 10.0.0-M1 to 10.0.0-M9

", ], - ), - ] + ], + "fixed_versions": ["10.0.0-M10"], + }, + ] + + results = extract_tomcat_advisory_data_from_page(page) + results = [d.to_dict() for d in results] + assert results == expected + + +def test_fetch_links(): + retrieved_links = ApacheTomcatImporter().fetch_advisory_links( + "https://tomcat.apache.org/security" + ) + + generator_result = [] + for link in retrieved_links: + generator_result.append(link) + + assert generator_result == [ + "https://tomcat.apache.org/security-11.html", + "https://tomcat.apache.org/security-10.html", + "https://tomcat.apache.org/security-9.html", + "https://tomcat.apache.org/security-8.html", + "https://tomcat.apache.org/security-7.html", + "https://tomcat.apache.org/security-6.html", + "https://tomcat.apache.org/security-5.html", + "https://tomcat.apache.org/security-4.html", + "https://tomcat.apache.org/security-3.html", + ] + + +def test_to_version_ranges(): + versions_data = [ + "1.0.0-2.0.0", + "3.2.2-3.2.3", + "3.3a-3.3.1", + "9.0.0.M1 to 9.0.0.M9", + "10.1.0-M1 to 10.1.0-M16", + ] + fixed_versions = ["3.0.0", "3.3.1a"] + + expected_versions_data_maven = "vers:maven/>=1.0.0|<=2.0.0|!=3.0.0|>=3.2.2|<=3.2.3|>=3.3a|<=3.3.1|!=3.3.1a|>=9.0.0.M1|<=9.0.0.M9|>=10.1.0-M1|<=10.1.0-M16" + + expected_MavenVersionRange_versions_data = MavenVersionRange( + constraints=( + VersionConstraint(comparator=">=", version=MavenVersion(string="1.0.0")), + VersionConstraint(comparator="<=", version=MavenVersion(string="2.0.0")), + VersionConstraint(comparator="!=", version=MavenVersion(string="3.0.0")), + VersionConstraint(comparator=">=", version=MavenVersion(string="3.2.2")), + VersionConstraint(comparator="<=", version=MavenVersion(string="3.2.3")), + VersionConstraint(comparator=">=", version=MavenVersion(string="3.3a")), + VersionConstraint(comparator="<=", version=MavenVersion(string="3.3.1")), + VersionConstraint(comparator="!=", version=MavenVersion(string="3.3.1a")), + VersionConstraint(comparator=">=", version=MavenVersion(string="9.0.0.M1")), + VersionConstraint(comparator="<=", version=MavenVersion(string="9.0.0.M9")), + VersionConstraint(comparator=">=", version=MavenVersion(string="10.1.0-M1")), + VersionConstraint(comparator="<=", version=MavenVersion(string="10.1.0-M16")), + ) + ) + + converted_versions_data_maven = to_version_ranges_maven(versions_data, fixed_versions) + + assert expected_MavenVersionRange_versions_data == converted_versions_data_maven + assert ( + MavenVersionRange.from_string(expected_versions_data_maven) == converted_versions_data_maven + ) + + expected_versions_data_apache = "vers:apache/>=1.0.0|<=2.0.0|!=3.0.0|>=3.2.2|<=3.2.3|>=3.3a|<=3.3.1|!=3.3.1a|>=9.0.0.M1|<=9.0.0.M9|>=10.1.0-M1|<=10.1.0-M16" + + expected_ApacheVersionRange_versions_data = ApacheVersionRange( + constraints=( + VersionConstraint(comparator=">=", version=SemverVersion(string="1.0.0")), + VersionConstraint(comparator="<=", version=SemverVersion(string="2.0.0")), + VersionConstraint(comparator="!=", version=SemverVersion(string="3.0.0")), + VersionConstraint(comparator=">=", version=SemverVersion(string="3.2.2")), + VersionConstraint(comparator="<=", version=SemverVersion(string="3.2.3")), + VersionConstraint(comparator=">=", version=SemverVersion(string="3.3a")), + VersionConstraint(comparator="<=", version=SemverVersion(string="3.3.1")), + VersionConstraint(comparator="!=", version=SemverVersion(string="3.3.1a")), + VersionConstraint(comparator=">=", version=SemverVersion(string="9.0.0.M1")), + VersionConstraint(comparator="<=", version=SemverVersion(string="9.0.0.M9")), + VersionConstraint(comparator=">=", version=SemverVersion(string="10.1.0-M1")), + VersionConstraint(comparator="<=", version=SemverVersion(string="10.1.0-M16")), + ) + ) - with open(TEST_DATA) as f: - found_advisories = self.data_src.to_advisories(f) + converted_versions_data_apache = to_version_ranges_apache(versions_data, fixed_versions) - found_advisories = list(map(AdvisoryData.normalized, found_advisories)) - expected_advisories = list(map(AdvisoryData.normalized, expected_advisories)) - assert sorted(found_advisories) == sorted(expected_advisories) + assert expected_ApacheVersionRange_versions_data == converted_versions_data_apache + assert ( + ApacheVersionRange.from_string(expected_versions_data_apache) + == converted_versions_data_apache + ) diff --git a/vulnerabilities/tests/test_data/apache_tomcat/apache_tomcat-selected-advisories.html b/vulnerabilities/tests/test_data/apache_tomcat/apache_tomcat-selected-advisories.html new file mode 100644 index 000000000..29be45f6c --- /dev/null +++ b/vulnerabilities/tests/test_data/apache_tomcat/apache_tomcat-selected-advisories.html @@ -0,0 +1,395 @@ + + + + + + + + apache_tomcat-selected-advisories.html + + + + + + + + +
+ +
nexB note: This file contains excerpts from https://tomcat.apache.org/security-9.html and other related Tomcat pages.
+ +

2 February 2021 Fixed in Apache Tomcat 9.0.43

+
+ +

Note: The issues below were fixed in Apache Tomcat 9.0.42 but the + release vote for the 9.0.42 release candidate did not pass. Therefore, + although users must download 9.0.43 to obtain a version that includes a + fix for these issues, version 9.0.42 is not included in the list of + affected versions.

+ +

Low: Fix for CVE-2020-9484 was incomplete + CVE-2021-25329 +

+ +

The fix for CVE-2020-9484 was incomplete. When using a + highly unlikely configuration edge case, the Tomcat instance was still + vulnerable to CVE-2020-9484. Note that both the previously + published prerequisites for CVE-2020-9484 and the previously + published non-upgrade mitigations for CVE-2020-9484 also apply to + this issue.

+ +

This was fixed with commit + 4785433a. +

+ +

This issue was reported to the Apache Tomcat Security team by Trung Pham + of Viettel Cyber Security on 12 January 2021. The issue was made public + on 1 March 2021.

+ +

Affects: 9.0.0.M1 to 9.0.41

+ +

Important: Request mix-up with h2c + CVE-2021-25122 +

+ +

When responding to new h2c connection requests, Apache Tomcat could + duplicate request headers and a limited amount of request body from one + request to another meaning user A and user B could both see the results of + user A's request.

+ +

This was fixed with commit + d47c20a7. +

+ +

This issue was identified by the Apache Tomcat Security team on 11 + January 2021. The issue was made public on 1 March 2021.

+ +

Affects: 9.0.0.M1 to 9.0.41

+ +
+ +

11 May 2020 Fixed in Apache Tomcat 9.0.35

+
+ +

Important: Remote Code Execution via session persistence + CVE-2020-9484 +

+ +

If:

+
    +
  • an attacker is able to control the contents and name of a file on the + server; and
  • +
  • the server is configured to use the PersistenceManager + with a FileStore; and
  • +
  • the PersistenceManager is configured with + sessionAttributeValueClassNameFilter="null" (the default + unless a SecurityManager is used) or a sufficiently lax + filter to allow the attacker provided object to be deserialized; + and +
  • +
  • the attacker knows the relative file path from the storage location + used by FileStore to the file the attacker has control + over;
  • +
+

then, using a specifically crafted request, the attacker will be able to + trigger remote code execution via deserialization of the file under their + control.

+ +

Note: All of conditions above must be true for the + attack to succeed.

+ +

As an alternative to upgrading to 9.0.35 or later, users may configure + the PersistenceManager with an appropriate value for + sessionAttributeValueClassNameFilter to ensure that only + application provided attributes are serialized and deserialized. +

+ +

This was fixed with commit + 3aa8f28d. +

+ +

This issue was reported to the Apache Tomcat Security Team by by jarvis + threedr3am of pdd security research on 12 April 2020. The issue was made + public on 20 May 2020.

+ +

Affects: 9.0.0.M1 to 9.0.34

+ +
+ +

not released Fixed in Apache Tomcat 9.0.9

+
+ +

Low: CORS filter has insecure defaults + CVE-2018-8014 +

+ +

The defaults settings for the CORS filter are insecure and enable + supportsCredentials for all origins. It is expected that + users of the CORS filter will have configured it appropriately for their + environment rather than using it in the default configuration. Therefore, + it is expected that most users will not be impacted by this issue. +

+ +

This was fixed in revision 1831726.

+ +

This issue was reported publicly on 1 May 2018 and formally announced as + a vulnerability on 16 May 2018.

+ +
+ +

13 June 2016 Fixed in Apache Tomcat 8.5.3 and 8.0.36

+
+ +

Moderate: Denial of Service + CVE-2016-3092 +

+ +

Apache Tomcat uses a package renamed copy of Apache Commons FileUpload to + implement the file upload requirements of the Servlet specification. A + denial of service vulnerability was identified in Commons FileUpload that + occurred when the length of the multipart boundary was just below the + size of the buffer (4096 bytes) used to read the uploaded file. This + caused the file upload process to take several orders of magnitude + longer than if the boundary was the typical tens of bytes long.

+ +

This was fixed in revision 1743722 for + 8.5.x and revision 1743738 for + 8.0.x.

+ +

This issue was identified by the TERASOLUNA Framework Development Team + and reported to the Apache Commons team via JPCERT on 9 May 2016. It was + made public on 21 June 2016.

+ +

Affects: 8.5.0 to 8.5.2, 8.0.0.RC1 to 8.0.35

+ +
+ +

released 4 Sep 2009 Fixed in Apache Tomcat 5.5.28

+
+

Important: Information Disclosure + CVE-2008-5515 +

+ +

When using a RequestDispatcher obtained from the Request, the target path + was normalised before the query string was removed. A request that + included a specially crafted request parameter could be used to access + content that would otherwise be protected by a security constraint or by + locating it in under the WEB-INF directory.

+ +

This was fixed in revisions 782757 and + 783291. +

+ +

This was first reported to the Tomcat security team on 11 Dec 2008 and + made public on 8 Jun 2009.

+ +

Affects: 5.5.0-5.5.27

+ +

Important: Denial of Service + CVE-2009-0033 +

+ +

If Tomcat receives a request with invalid headers via the Java AJP + connector, it does not return an error and instead closes the AJP + connection. In case this connector is member of a mod_jk load balancing + worker, this member will be put into an error state and will be blocked + from use for approximately one minute. Thus the behaviour can be used for + a denial of service attack using a carefully crafted request.

+ +

This was fixed in revision 781362.

+ +

This was first reported to the Tomcat security team on 26 Jan 2009 and + made public on 3 Jun 2009.

+ +

Affects: 5.5.0-5.5.27

+ +

Low: Information disclosure + CVE-2009-0580 +

+ +

Due to insufficient error checking in some authentication classes, Tomcat + allows for the enumeration (brute force testing) of user names by + supplying illegally URL encoded passwords. The attack is possible if FORM + based authentication (j_security_check) is used with the MemoryRealm. + Note that in early versions, the DataSourceRealm and JDBCRealm were also + affected.

+ +

This was fixed in revision 781379.

+ +

This was first reported to the Tomcat security team on 25 Feb 2009 and + made public on 3 Jun 2009.

+ +

Affects: 5.5.0-5.5.27 (Memory Realm), 5.5.0-5.5.5 (DataSource and JDBC + Realms)

+ +

Low: Cross-site scripting + CVE-2009-0781 +

+ +

The calendar application in the examples web application contains an + XSS flaw due to invalid HTML which renders the XSS filtering protection + ineffective.

+ +

This was fixed in revision 750928.

+ +

This was first reported to the Tomcat security team on 5 Mar 2009 and + made public on 6 Mar 2009.

+ +

Affects: 5.5.0-5.5.27

+ +

Low: Information disclosure + CVE-2009-0783 +

+ +

Bugs 29936 and 45933 allowed a web application + to replace the XML parser used by + Tomcat to process web.xml, context.xml and tld files. In limited + circumstances these bugs may allow a rogue web application to view and/or + alter the web.xml, context.xml and tld files of other web applications + deployed on the Tomcat instance.

+ +

This was fixed in revisions 681156 and + 781542. +

+ +

This was first reported to the Tomcat security team on 2 Mar 2009 and + made public on 4 Jun 2009.

+ +

Affects: 5.5.0-5.5.27

+ +
+ +

Will not be fixed in Apache Tomcat 4.1.x

+
+

Moderate: Information disclosure + CVE-2005-4836 +

+ +

The deprecated HTTP/1.1 connector does not reject request URIs containing + null bytes when used with contexts that are configured with + allowLinking="true". Failure to reject the null byte enables an attacker + to obtain the source for any JSP page in these contexts. Users of Tomcat + 4.1.x are advised to use the default, supported Coyote HTTP/1.1 connector + which does not exhibit this issue. There are no plans to issue an update + to Tomcat 4.1.x for this issue.

+ +

Affects: 4.1.15-4.1.SVN

+ +
+ +

Fixed in Apache Tomcat 4.1.35

+
+ +

Low: Information disclosure + CVE-2008-4308 +

+ +

Bug + 40771 may result in the disclosure of POSTed content from a previous + request. For a vulnerability to exist, the content read from the input + stream must be disclosed, eg via writing it to the response and committing + the response, before the ArrayIndexOutOfBoundsException occurs which will + halt processing of the request.

+ +

Affects: 4.1.32-4.1.34 (4.0.x unknown)

+
+ +

Fixed in Apache Tomcat 4.1.3

+
+

Important: Denial of service + CVE-2002-0935 +

+ +

A malformed HTTP request can cause the request processing thread to + become unresponsive. A sequence of such requests will cause all request + processing threads, and hence Tomcat as a whole, to become unresponsive.

+ +

Affects: 4.0.0-4.0.2?, 4.0.3, 4.0.4-4.0.6?, 4.1.0-4.1.2?

+ +
+ +

Fixed in Apache Tomcat 3.3a

+
+

Moderate: Information disclosure + CVE-2002-2007 +

+ +

Non-standard requests to the sample applications installed by default + could result in unexpected directory listings or disclosure of the full + file system path for a JSP.

+ +

Affects: 3.2.3-3.2.4

+ +

Low: Information disclosure + CVE-2002-2006, + CVE-2000-0760 +

+ +

The snoop servlet installed as part of the examples includes output that + identifies the Tomcat installation path. There are no plans to issue a an + update to Tomcat 3.x for this issue.

+ +

Affects:3.1-3.1.1, 3.2-3.2.4

+
+ +
+ + + + diff --git a/vulnerabilities/tests/test_data/apache_tomcat/parse-apache_tomcat-selected-advisories-expected.json b/vulnerabilities/tests/test_data/apache_tomcat/parse-apache_tomcat-selected-advisories-expected.json new file mode 100644 index 000000000..1a116dce9 --- /dev/null +++ b/vulnerabilities/tests/test_data/apache_tomcat/parse-apache_tomcat-selected-advisories-expected.json @@ -0,0 +1,854 @@ +[ + { + "aliases": [ + "CVE-2020-9484" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=9.0.0+M1|<=9.0.41|!=9.0.43", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=9.0.0.M1|<=9.0.41|!=9.0.43", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2020-9484", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9484", + "severities": [ + { + "system": "apache_tomcat", + "value": "Low", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://github.com/apache/tomcat/commit/4785433a226a20df6acbea49296e1ce7e23de453", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2021-25329" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=9.0.0+M1|<=9.0.41|!=9.0.43", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=9.0.0.M1|<=9.0.41|!=9.0.43", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2021-25329", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-25329", + "severities": [ + { + "system": "apache_tomcat", + "value": "Low", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://github.com/apache/tomcat/commit/4785433a226a20df6acbea49296e1ce7e23de453", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2021-25122" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=9.0.0+M1|<=9.0.41|!=9.0.43", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=9.0.0.M1|<=9.0.41|!=9.0.43", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2021-25122", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-25122", + "severities": [ + { + "system": "apache_tomcat", + "value": "Important", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://github.com/apache/tomcat/commit/d47c20a776e8919eaca8da9390a32bc8bf8210b1", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2020-9484" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=9.0.0+M1|<=9.0.34|!=9.0.35", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=9.0.0.M1|<=9.0.34|!=9.0.35", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2020-9484", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9484", + "severities": [ + { + "system": "apache_tomcat", + "value": "Important", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://github.com/apache/tomcat/commit/3aa8f28db7efb311cdd1b6fe15a9cd3b167a2222", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2018-8014" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=9.0.0+M1|<=9.0.8|!=9.0.9", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=9.0.0.M1|<=9.0.8|!=9.0.9", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2018-8014", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-8014", + "severities": [ + { + "system": "apache_tomcat", + "value": "Low", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://svn.apache.org/viewvc?view=rev&rev=1831726", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2016-3092" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=8.0.0+RC1|<=8.0.35|!=8.0.36|>=8.5.0|<=8.5.2|!=8.5.3", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=8.0.0.RC1|<=8.0.35|!=8.0.36|>=8.5.0|<=8.5.2|!=8.5.3", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2016-3092", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3092", + "severities": [ + { + "system": "apache_tomcat", + "value": "Moderate", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://svn.apache.org/viewvc?view=rev&rev=1743722", + "severities": [] + }, + { + "reference_id": "", + "url": "https://svn.apache.org/viewvc?view=rev&rev=1743738", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2008-5515" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=5.5.0|<=5.5.27|!=5.5.28", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=5.5.0|<=5.5.27|!=5.5.28", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2008-5515", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5515", + "severities": [ + { + "system": "apache_tomcat", + "value": "Important", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://svn.apache.org/viewvc?view=rev&rev=782757", + "severities": [] + }, + { + "reference_id": "", + "url": "https://svn.apache.org/viewvc?view=rev&rev=783291", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2009-0033" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=5.5.0|<=5.5.27|!=5.5.28", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=5.5.0|<=5.5.27|!=5.5.28", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2009-0033", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0033", + "severities": [ + { + "system": "apache_tomcat", + "value": "Important", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://svn.apache.org/viewvc?view=rev&rev=781362", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2009-0580" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=5.5.0|<=5.5.27|!=5.5.28", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=5.5.0|<=5.5.27|!=5.5.28", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2009-0580", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0580", + "severities": [ + { + "system": "apache_tomcat", + "value": "Low", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://svn.apache.org/viewvc?view=rev&rev=781379", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2009-0781" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=5.5.0|<=5.5.27|!=5.5.28", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=5.5.0|<=5.5.27|!=5.5.28", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2009-0781", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0781", + "severities": [ + { + "system": "apache_tomcat", + "value": "Low", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://svn.apache.org/viewvc?view=rev&rev=750928", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2009-0783" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=5.5.0|<=5.5.27|!=5.5.28", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=5.5.0|<=5.5.27|!=5.5.28", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2009-0783", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0783", + "severities": [ + { + "system": "apache_tomcat", + "value": "Low", + "scoring_elements": "" + } + ] + }, + { + "reference_id": "", + "url": "https://svn.apache.org/viewvc?view=rev&rev=681156", + "severities": [] + }, + { + "reference_id": "", + "url": "https://svn.apache.org/viewvc?view=rev&rev=781542", + "severities": [] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2005-4836" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/<=4.1.0+SVN|>=4.1.15", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/<=4.1.SVN|>=4.1.15", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2005-4836", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-4836", + "severities": [ + { + "system": "apache_tomcat", + "value": "Moderate", + "scoring_elements": "" + } + ] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2008-4308" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=4.1.32|<=4.1.34|!=4.1.35", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=4.1.32|<=4.1.34|!=4.1.35", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2008-4308", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4308", + "severities": [ + { + "system": "apache_tomcat", + "value": "Low", + "scoring_elements": "" + } + ] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2002-0935" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=4.0.0|<=4.0.2|4.0.3|>=4.0.4|<=4.0.6|>=4.1.0|<=4.1.2|!=4.1.3", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=4.0.0|<=4.0.2|4.0.3|>=4.0.4|<=4.0.6|>=4.1.0|<=4.1.2|!=4.1.3", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2002-0935", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2002-0935", + "severities": [ + { + "system": "apache_tomcat", + "value": "Important", + "scoring_elements": "" + } + ] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2002-2007" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=3.2.3|<=3.2.4|!=3.3.0-a", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=3.2.3|<=3.2.4|!=3.3a", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2002-2007", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2002-2007", + "severities": [ + { + "system": "apache_tomcat", + "value": "Moderate", + "scoring_elements": "" + } + ] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2002-2006" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=3.1.0|<=3.1.1|>=3.2.0|<=3.2.4|!=3.3.0-a", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=3.1|<=3.1.1|>=3.2|<=3.2.4|!=3.3a", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2002-2006", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2002-2006", + "severities": [ + { + "system": "apache_tomcat", + "value": "Low", + "scoring_elements": "" + } + ] + } + ], + "date_published": null + }, + { + "aliases": [ + "CVE-2000-0760" + ], + "summary": "", + "affected_packages": [ + { + "package": { + "type": "apache", + "namespace": null, + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:apache/>=3.1.0|<=3.1.1|>=3.2.0|<=3.2.4|!=3.3.0-a", + "fixed_version": null + }, + { + "package": { + "type": "maven", + "namespace": "org.apache.tomcat", + "name": "tomcat", + "version": null, + "qualifiers": null, + "subpath": null + }, + "affected_version_range": "vers:maven/>=3.1|<=3.1.1|>=3.2|<=3.2.4|!=3.3a", + "fixed_version": null + } + ], + "references": [ + { + "reference_id": "CVE-2000-0760", + "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2000-0760", + "severities": [ + { + "system": "apache_tomcat", + "value": "Low", + "scoring_elements": "" + } + ] + } + ], + "date_published": null + } +] diff --git a/vulnerabilities/tests/test_data/apache_tomcat/security-9.html b/vulnerabilities/tests/test_data/apache_tomcat/security-9.html deleted file mode 100644 index 0931f9274..000000000 --- a/vulnerabilities/tests/test_data/apache_tomcat/security-9.html +++ /dev/null @@ -1,140 +0,0 @@ - -Apache Tomcat® - Apache Tomcat 9 vulnerabilities

Content

Table of Contents

Apache Tomcat 9.x vulnerabilities

-

This page lists all security vulnerabilities fixed in released versions - of Apache Tomcat 9.x. Each vulnerability is given a - security impact rating by the Apache - Tomcat security team — please note that this rating may vary from - platform to platform. We also list the versions of Apache Tomcat the flaw - is known to affect, and where a flaw has not been verified list the - version with a question mark.

- -

Note: Vulnerabilities that are not Tomcat vulnerabilities - but have either been incorrectly reported against Tomcat or where Tomcat - provides a workaround are listed at the end of this page.

- -

Please note that binary patches are never provided. If you need to - apply a source code patch, use the building instructions for the - Apache Tomcat version that you are using. For Tomcat 9.0 those are - building.html and - BUILDING.txt. - Both files can be found in the webapps/docs subdirectory - of a binary distribution. You may also want to review the - Security Considerations - page in the documentation.

- -

If you need help on building or configuring Tomcat or other help on - following the instructions to mitigate the known vulnerabilities listed - here, please send your questions to the public - Tomcat Users mailing list -

- -

If you have encountered an unlisted security vulnerability or other - unexpected behaviour that has security - impact, or if the descriptions here are incomplete, - please report them privately to the - Tomcat Security Team. Thank you. -

-

5 January 2016 Fixed in Apache Tomcat 9.0.0.M3

- -

Moderate: Security Manager bypass - CVE-2016-0763

- -

This issue only affects users running untrusted web applications under a - security manager.

- -

ResourceLinkFactory.setGlobalContext() is a public method - and was accessible to web applications even when running under a security - manager. This allowed a malicious web application to inject a malicious - global context that could in turn be used to disrupt other web - applications and/or read and write data owned by other web - applications.

- -

This was fixed in revision 1725926.

- -

This issue was identified by the Tomcat security team on 18 January 2016 - and made public on 22 February 2016.

- -

Affects: 9.0.0.M1 to 9.0.0.M2

- -

Note: The issues below were fixed in Apache Tomcat 9.0.0.M2 but the - release vote for the 9.0.0.M2 release candidate did not pass. Therefore, - although users must download 9.0.0.M3 to obtain a version that includes - fixes for these issues, version 9.0.0.M2 is not included in the list of - affected versions.

- -

Moderate: CSRF token leak - CVE-2015-5351

- -

The index page of the Manager and Host Manager applications included a - valid CSRF token when issuing a redirect as a result of an - unauthenticated request to the root of the web application. If an - attacker had access to the Manager or Host Manager applications - (typically these applications are only accessible to internal users, not - exposed to the Internet), this token could then be used by the attacker - to construct a CSRF attack.

- -

This was fixed in revisions 1720652 and - 1720655.

- -

This issue was identified by the Tomcat security team on 8 December 2015 - and made public on 22 February 2016.

- -

Affects: 8.0.0.M1 to 9.0.0, 9.0.1.M1 to 9.0.1.M2-

- -

Low: Security Manager bypass - CVE-2016-0706

- -

This issue only affects users running untrusted web applications under a - security manager.

- -

The internal StatusManagerServlet could be loaded by a malicious web - application when a security manager was configured. This servlet could - then provide the malicious web application with a list of all deployed - applications and a list of the HTTP request lines for all requests - currently being processed. This could have exposed sensitive information - from other web applications, such as session IDs, to the web - application.

- -

This was fixed in revision 1722799.

- -

This issue was identified by the Tomcat security team on 27 December 2015 - and made public on 22 February 2016.

- -

Affects: 9.0.0.M1

- -

Moderate: Security Manager bypass - CVE-2016-0714

- -

This issue only affects users running untrusted web applications under a - security manager.

- -

Tomcat provides several session persistence mechanisms. The - StandardManager persists session over a restart. The - PersistentManager is able to persist sessions to files, a - database or a custom Store. The cluster implementation - persists sessions to one or more additional nodes in the cluster. All of - these mechanisms could be exploited to bypass a security manager. Session - persistence is performed by Tomcat code with the permissions assigned to - Tomcat internal code. By placing a carefully crafted object into a - session, a malicious web application could trigger the execution of - arbitrary code.

- -

This was fixed in revisions 1725263 and - 1725914.

- -

This issue was identified by the Tomcat security team on 12 November 2015 - and made public on 22 February 2016.

- -

Affects: 9.0.0.M1-9.0.0.M2

- -
- Copyright © 1999-2020, The Apache Software Foundation -
- Apache Tomcat, Tomcat, Apache, the Apache feather, and the Apache Tomcat - project logo are either registered trademarks or trademarks of the Apache - Software Foundation. -
\ No newline at end of file