Vulnerabilities in pkg:pypi/potato-annotation

PACKAGE
Advisory Summary

GHSA-q9m2-fhv9-3jcf is a MODERATE (CVSS 5.1) `potato-annotation` has a project-boundary bypass vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Potato annotation libraries in the PyPI ecosystem. The issue involves `potato-annotation` has a project-boundary bypass. Remediation is available by upgrading affected packages to version 2.4.5.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/potato-annotation

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-q9m2-fhv9-3jcf - MODERATE `potato-annotation` has a Project-Boundary Bypass

GHSA-q9m2-fhv9-3jcf at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-q9m2-fhv9-3jcf
Severity MODERATE
CVSS v3.1 Base Score 5.1
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Potato annotation
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.1

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

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

How to Fix GHSA-q9m2-fhv9-3jcf

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

potato-annotation fixed: 2.4.5
pip install potato-annotation>=2.4.5
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 potato-annotation

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-q9m2-fhv9-3jcf, inspect your installed packages using pip:

pip show potato-annotation

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

Note: The pip show potato-annotation 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 Potato annotation, 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

## Summary `validate_path_security` uses string-prefix containment (`startswith`) for boundary checks. This allows paths that are **outside** the intended project directory but share its prefix string (e.g., `/tmp/potato_proj_demo_evil/...` vs `/tmp/potato_proj_demo`) to be accepted. ## Details ### Affected source location (root cause) **File:** `potato/server_utils/config_module.py` **Snippet (lines 370–373):** ```python real_path = os.path.realpath(normalized_path) real_base = os.path.realpath(base_dir) if not real_path.startswith(real_base): raise ConfigSecurityError(...) ``` **Snippet (lines 384–389):** ```python real_path = os.path.realpath(normalized_path) check_dir = project_dir if project_dir else base_dir real_check_dir = os.path.realpath(check_dir) if not real_path.startswith(real_check_dir): raise ConfigSecurityError(...) ``` `startswith()` is string-based, so `/tmp/potato_proj_demo_evil/...` passes when checked against `/tmp/potato_proj_demo`. ### Confirmed affected call sites **File:** `potato/server_utils/config_module.py` 1) `validate_file_paths` task_dir branch (line 2113) ```python validated_task_dir = validate_path_security(task_dir, project_dir) ``` 2) `validate_file_paths` data_files branch (line 2151) ```python validated_path = validate_path_security(file_path, base_dir, project_dir) ``` 3) `validate_training_config` training.data_file branch (line 2286) ```python validated_path = validate_path_security(data_file, base_dir, project_dir) ``` ## PoC ```python from potato.server_utils.config_module import validate_path_security base = '/tmp/potato_proj_demo' vuln = '/tmp/potato_proj_demo_evil/file.txt' try: print('inside=', validate_path_security('/tmp/potato_proj_demo/file.txt', base, base)) except Exception as e: print('inside_error=', type(e).__name__, e) try: validate_path_security('/tmp/other_demo/file.txt', base, base) except Exception as e: print('baseline=', type(e).__name__, e) print('trigger=', validate_path_security(vuln, base, base)) ``` ## Impact - Can allow unauthorized sibling-prefix file access outside intended project boundary. - Can affect read paths (`data_files`, `training.data_file`, `base_css`, `header_logo`) and output/path placement depending on configuration.

GHSA-q9m2-fhv9-3jcf Affected Potato annotation Versions

1 component(s)
Fixed Versions:
2.4.5
Product / Package Ecosystem Affected Versions Fixed Version
potato-annotation
PyPI
≥ 2.0.0
< 2.4.5
2.4.5

References

Frequently Asked Questions

What is GHSA-q9m2-fhv9-3jcf?
GHSA-q9m2-fhv9-3jcf is a security vulnerability in Potato annotation involving `potato-annotation` has a Project-Boundary Bypass under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Potato annotation versions are affected?
Affected versions include releases prior to 2.4.5 across affected packages: potato-annotation.
What version fixes GHSA-q9m2-fhv9-3jcf?
Upgrading to 2.4.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is potato-annotation affected?
Yes, potato-annotation is affected in releases prior to 2.4.5. Upgrade your dependency to 2.4.5 or later.
What is the CVSS score of GHSA-q9m2-fhv9-3jcf?
GHSA-q9m2-fhv9-3jcf has a CVSS v3.1 base score of 5.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with GHSA-q9m2-fhv9-3jcf?
GHSA-q9m2-fhv9-3jcf 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 GHSA-q9m2-fhv9-3jcf?
Run the dependency tree command: 'pip show potato-annotation'. 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-q9m2-fhv9-3jcf",
  "modified" : "2026-05-08T17:31:07Z",
  "published" : "2026-05-08T17:31:07Z",
  "aliases" : [ ],
  "summary" : "`potato-annotation` has a Project-Boundary Bypass",
  "details" : "## Summary\n`validate_path_security` uses string-prefix containment (`startswith`) for boundary checks. This allows paths that are **outside** the intended project directory but share its prefix string (e.g., `/tmp/potato_proj_demo_evil/...` vs `/tmp/potato_proj_demo`) to be accepted.\n\n## Details\n### Affected source location (root cause)\n**File:** `potato/server_utils/config_module.py`\n\n**Snippet (lines 370–373):**\n```python\nreal_path = os.path.realpath(normalized_path)\nreal_base = os.path.realpath(base_dir)\nif not real_path.startswith(real_base):\n    raise ConfigSecurityError(...)\n```\n\n**Snippet (lines 384–389):**\n```python\nreal_path = os.path.realpath(normalized_path)\ncheck_dir = project_dir if project_dir else base_dir\nreal_check_dir = os.path.realpath(check_dir)\nif not real_path.startswith(real_check_dir):\n    raise ConfigSecurityError(...)\n```\n\n`startswith()` is string-based, so `/tmp/potato_proj_demo_evil/...` passes when checked against `/tmp/potato_proj_demo`.\n\n### Confirmed affected call sites\n**File:** `potato/server_utils/config_module.py`\n\n1) `validate_file_paths` task_dir branch (line 2113)\n```python\nvalidated_task_dir = validate_path_security(task_dir, project_dir)\n```\n\n2) `validate_file_paths` data_files branch (line 2151)\n```python\nvalidated_path = validate_path_security(file_path, base_dir, project_dir)\n```\n\n3) `validate_training_config` training.data_file branch (line 2286)\n```python\nvalidated_path = validate_path_security(data_file, base_dir, project_dir)\n```\n\n## PoC\n```python\nfrom potato.server_utils.config_module import validate_path_security\n\nbase = '/tmp/potato_proj_demo'\nvuln = '/tmp/potato_proj_demo_evil/file.txt'\n\ntry:\n    print('inside=', validate_path_security('/tmp/potato_proj_demo/file.txt', base, base))\nexcept Exception as e:\n    print('inside_error=', type(e).__name__, e)\n\ntry:\n    validate_path_security('/tmp/other_demo/file.txt', base, base)\nexcept Exception as e:\n    print('baseline=', type(e).__name__, e)\n\nprint('trigger=', validate_path_security(vuln, base, base))\n```\n\n## Impact\n- Can allow unauthorized sibling-prefix file access outside intended project boundary.\n- Can affect read paths (`data_files`, `training.data_file`, `base_css`, `header_logo`) and output/path placement depending on configuration.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "potato-annotation"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.4.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/davidjurgens/potato/security/advisories/GHSA-q9m2-fhv9-3jcf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/davidjurgens/potato"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-08T17:31:07Z",
    "nvd_published_at" : null
  }
}