Vulnerabilities in pkg:pypi/cherrypy

PACKAGE
Advisory Identifier: GHSA-76x8-gg39-5jjg
Advisory Summary

CVE-2008-0252 is a HIGH (CVSS 7.5) cherrypy malicious cookies allow access vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Cherrypy libraries in the PyPI ecosystem. The issue involves cherrypy malicious cookies allow access to files outside the session directory. Remediation is available by upgrading affected packages to version 2.1.1, 3.0.2.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/cherrypy

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/cherrypy. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-76x8-gg39-5jjg CVE-2008-0252 HIGH CherryPy Malicious cookies allow access to files outside the session directory
GHSA-vx77-5pf4-c9wr CVE-2006-0847 HIGH CherryPy Directory traversal vulnerability

CVE-2008-0252 at a Glance

CVE Identifier CVE-2008-0252
GHSA Identifier GHSA-76x8-gg39-5jjg
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Cherrypy
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2008-0252

To remediate this vulnerability, upgrade all affected Cherrypy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

cherrypy fixed: 2.1.1
pip install cherrypy>=2.1.1
cherrypy fixed: 3.0.2
pip install cherrypy>=3.0.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show cherrypy

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2008-0252, inspect your installed packages using pip:

pip show cherrypy

Analyze the terminal output to locate any version of Cherrypy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.1), your application is affected.

Note: The pip show cherrypy command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Cherrypy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Directory traversal vulnerability in the _get_file_path function in (1) `lib/sessions.py` in CherryPy 3.0.x up to 3.0.2, (2) `filter/sessionfilter.py` in CherryPy 2.1, and (3) `filter/sessionfilter.py` in CherryPy 2.x allows remote attackers to create or delete arbitrary files, and possibly read and write portions of arbitrary files, via a crafted session id in a cookie.

CVE-2008-0252 Affected Cherrypy Versions

2 component(s)
Fixed Versions:
2.1.13.0.2
Product / Package Ecosystem Affected Versions Fixed Version
cherrypy
PyPI
< 2.1.1
2.1.1
cherrypy
PyPI
≥ 3.0
< 3.0.2
3.0.2

References

NVD — CVE-2008-0252 NVD
https://nvd.nist.gov/vuln/detail/CVE-2008-0252
Security Fix Commit FIX COMMIT
https://github.com/cherrypy/cherrypy/commit/37b856eba6f207231c691dae2e5b24e072f86664
bugs.gentoo.org/show_bug.cgi WEB
https://bugs.gentoo.org/show_bug.cgi?id=204829
Cherrypy Source Repository REPOSITORY
https://github.com/cherrypy/cherrypy
Cherrypy Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/cherrypy/PYSEC-2008-3.yaml
issues.rpath.com/browse/rpl-2127 WEB
https://issues.rpath.com/browse/RPL-2127
web.archive.org/web/20080129011723/... WEB
https://web.archive.org/web/20080129011723/http://secunia.com/advisories/28354
web.archive.org/web/20080312130713/... WEB
https://web.archive.org/web/20080312130713/http://secunia.com/advisories/28353
web.archive.org/web/20080328003510/... WEB
https://web.archive.org/web/20080328003510/http://secunia.com/advisories/28611
web.archive.org/web/20100122080212/... WEB
https://web.archive.org/web/20100122080212/http://www.vupen.com/english/advisories/2008/0039
web.archive.org/web/20110513223620/... WEB
https://web.archive.org/web/20110513223620/http://secunia.com/advisories/28769
web.archive.org/web/20111224161644/... WEB
https://web.archive.org/web/20111224161644/http://secunia.com/advisories/28620
Cherrypy Security Information SECURITY
https://web.archive.org/web/20151108024505/http://www.securityfocus.com/bid/27181
www.redhat.com/archives/fedora-pac... WEB
https://www.redhat.com/archives/fedora-package-announce/2008-January/msg00240.html
www.redhat.com/archives/fedora-pac... WEB
https://www.redhat.com/archives/fedora-package-announce/2008-January/msg00297.html
Cherrypy Security Information SECURITY
http://security.gentoo.org/glsa/glsa-200801-11.xml
Cherrypy Security Information SECURITY
http://www.cherrypy.org/changeset/1774
Cherrypy Security Information SECURITY
http://www.cherrypy.org/changeset/1775
Cherrypy Security Information SECURITY
http://www.cherrypy.org/changeset/1776
Cherrypy Security Information SECURITY
http://www.cherrypy.org/ticket/744
Cherrypy Security Information SECURITY
http://www.debian.org/security/2008/dsa-1481

Frequently Asked Questions

What is CVE-2008-0252?
CVE-2008-0252 is a security vulnerability in Cherrypy involving CherryPy Malicious cookies allow access to files outside the session directory under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Cherrypy versions are affected?
Affected versions include releases prior to 2.1.1, 3.0.2 across affected packages: cherrypy.
What version fixes CVE-2008-0252?
Upgrading to 2.1.1, 3.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cherrypy affected?
Yes, cherrypy is affected in releases prior to 2.1.1, 3.0.2. Upgrade your dependency to 2.1.1, 3.0.2 or later.
What is the CVSS score of CVE-2008-0252?
CVE-2008-0252 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2008-0252?
CVE-2008-0252 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2008-0252?
Run the dependency tree command: 'pip show cherrypy'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-76x8-gg39-5jjg",
  "modified" : "2024-09-13T18:02:56Z",
  "published" : "2022-05-01T23:28:42Z",
  "aliases" : [ "CVE-2008-0252" ],
  "summary" : "CherryPy Malicious cookies allow access to files outside the session directory",
  "details" : "Directory traversal vulnerability in the _get_file_path function in (1) `lib/sessions.py` in CherryPy 3.0.x up to 3.0.2, (2) `filter/sessionfilter.py` in CherryPy 2.1, and (3) `filter/sessionfilter.py` in CherryPy 2.x allows remote attackers to create or delete arbitrary files, and possibly read and write portions of arbitrary files, via a crafted session id in a cookie.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "cherrypy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "cherrypy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0"
      }, {
        "fixed" : "3.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2008-0252"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cherrypy/cherrypy/commit/37b856eba6f207231c691dae2e5b24e072f86664"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.gentoo.org/show_bug.cgi?id=204829"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cherrypy/cherrypy"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/cherrypy/PYSEC-2008-3.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://issues.rpath.com/browse/RPL-2127"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20080129011723/http://secunia.com/advisories/28354"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20080312130713/http://secunia.com/advisories/28353"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20080328003510/http://secunia.com/advisories/28611"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20100122080212/http://www.vupen.com/english/advisories/2008/0039"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20110513223620/http://secunia.com/advisories/28769"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20111224161644/http://secunia.com/advisories/28620"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20151108024505/http://www.securityfocus.com/bid/27181"
  }, {
    "type" : "WEB",
    "url" : "https://www.redhat.com/archives/fedora-package-announce/2008-January/msg00240.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.redhat.com/archives/fedora-package-announce/2008-January/msg00297.html"
  }, {
    "type" : "WEB",
    "url" : "http://security.gentoo.org/glsa/glsa-200801-11.xml"
  }, {
    "type" : "WEB",
    "url" : "http://www.cherrypy.org/changeset/1774"
  }, {
    "type" : "WEB",
    "url" : "http://www.cherrypy.org/changeset/1775"
  }, {
    "type" : "WEB",
    "url" : "http://www.cherrypy.org/changeset/1776"
  }, {
    "type" : "WEB",
    "url" : "http://www.cherrypy.org/ticket/744"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2008/dsa-1481"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-01T19:52:43Z",
    "nvd_published_at" : "2008-01-12T02:46:00Z"
  }
}