Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vuln): support last_affected field from osv #4944

Merged
merged 3 commits into from
Aug 20, 2023

Conversation

nikpivkin
Copy link
Contributor

@nikpivkin nikpivkin commented Aug 4, 2023

Description

Dockerfile:

FROM python:3.8-alpine
RUN pip install aiohttp==3.8.5

Before

cat report.json | jq '.Results[] | select(.Target == "Python") | .Vulnerabilities[] | select(.PkgName == "aiohttp") | .VulnerabilityID'
{
  "VulnerabilityID": "CVE-2023-37276",
  "PkgName": "aiohttp",
  "PkgPath": "usr/local/lib/python3.8/site-packages/aiohttp-3.8.5.dist-info/METADATA",
  "InstalledVersion": "3.8.5",
  "Layer": {
    "DiffID": "sha256:b9ecda324e6328f1d6402bf4283de1529f04c835a4a47b0ee71f15851aac9356"
  },
  "SeveritySource": "nvd",
  "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2023-37276",
  "DataSource": {
    "ID": "osv",
    "Name": "Python Packaging Advisory Database",
    "URL": "https://github.com/pypa/advisory-db"
  },
  "Title": "HTTP request smuggling via llhttp HTTP request parser",
  "Description": "aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. aiohttp v3.8.4 and earlier are bundled with llhttp v6.0.6. Vulnerable code is used by aiohttp for its HTTP request parser when available which is the default case when installing from a wheel. This vulnerability only affects users of aiohttp as an HTTP server (ie `aiohttp.Application`), you are not affected by this vulnerability if you are using aiohttp as an HTTP client library (ie `aiohttp.ClientSession`). Sending a crafted HTTP request will cause the server to misinterpret one of the HTTP header values leading to HTTP request smuggling. This issue has been addressed in version 3.8.5. Users are advised to upgrade. Users unable to upgrade can reinstall aiohttp using `AIOHTTP_NO_EXTENSIONS=1` as an environment variable to disable the llhttp HTTP request parser implementation. The pure Python implementation isn't vulnerable.",
  "Severity": "HIGH",
  "CweIDs": [
    "CWE-444"
  ],
  "CVSS": {
    "ghsa": {
      "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N",
      "V3Score": 5.3
    },
    "nvd": {
      "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
      "V3Score": 7.5
    },
    "redhat": {
      "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
      "V3Score": 7.5
    }
  },
  "References": [
    "https://access.redhat.com/security/cve/CVE-2023-37276",
    "https://github.com/advisories/GHSA-45c4-8wx5-qw6w",
    "https://github.com/aio-libs/aiohttp",
    "https://github.com/aio-libs/aiohttp/blob/v3.8.4/.gitmodules",
    "https://github.com/aio-libs/aiohttp/commit/9337fb3f2ab2b5f38d7e98a194bde6f7e3d16c40",
    "https://github.com/aio-libs/aiohttp/commit/9c13a52c21c23dfdb49ed89418d28a5b116d0681",
    "https://github.com/aio-libs/aiohttp/security/advisories/GHSA-45c4-8wx5-qw6w",
    "https://github.com/pypa/advisory-database/tree/main/vulns/aiohttp/PYSEC-2023-120.yaml",
    "https://hackerone.com/reports/2001873",
    "https://nvd.nist.gov/vuln/detail/CVE-2023-37276",
    "https://www.cve.org/CVERecord?id=CVE-2023-37276"
  ],
  "PublishedDate": "2023-07-19T20:15:00Z",
  "LastModifiedDate": "2023-07-28T15:55:00Z"
}

After

cat report.json | jq '.Results[] | select(.Target == "Python") | .Vulnerabilities[] | select(.PkgName == "aiohttp")'

Related issues

Related PRs

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

Copy link

@JonZeolla JonZeolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good POC but I suggest focusing on getting aquasecurity/trivy-db#338 in instead

@nikpivkin nikpivkin marked this pull request as ready for review August 18, 2023 06:28
@knqyf263 knqyf263 added this pull request to the merge queue Aug 20, 2023
Copy link

@JonZeolla JonZeolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Merged via the queue into aquasecurity:main with commit 9ace591 Aug 20, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(vuln): support last_affected field from osv
3 participants