{"answers":{"affected":"2 open source packages ship an affected version, including potato-annotation.","exploited":"There is no known exploitation of GHSA-q9m2-fhv9-3jcf in the wild and no public exploit code.","fix":"Upgrade potato-annotation to 2.4.5 or later.","what":"GHSA-q9m2-fhv9-3jcf is a path traversal vulnerability in potato-annotation, published on 8 May 2026."},"fix_prompt":"Check this codebase for GHSA-q9m2-fhv9-3jcf and fix it if it is affected.\n\nWhat it is: GHSA-q9m2-fhv9-3jcf is a path traversal vulnerability in potato-annotation, published on 8 May 2026. \nExploitation: There is no known exploitation of GHSA-q9m2-fhv9-3jcf in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- potato-annotation (PyPI): affected from 2.0.0; fixed in 2.4.5\n- potato-annotation (PyPI): affected from 2.0.0; fixed in 2.4.5\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-q9m2-fhv9-3jcf/ (Markdown: https://insights.sbomify.com/GHSA-q9m2-fhv9-3jcf/index.md)","id":"GHSA-q9m2-fhv9-3jcf","markdown":"https://insights.sbomify.com/GHSA-q9m2-fhv9-3jcf/index.md","name":"GHSA-q9m2-fhv9-3jcf","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"patch","impacts":["data_read","data_modify"],"network_reachable":"unknown","non_default_config":false,"product_category":"Python annotation library","requires_auth":"unknown","summary":"Attackers can bypass project boundary checks to access or modify files outside the intended directory due to flawed string-prefix validation.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## 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.","ecosystems":["PyPI"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"`potato-annotation` has a Project-Boundary Bypass","id":"GHSA-q9m2-fhv9-3jcf","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"path_traversal","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"PyPI","fixed":["2.4.5"],"introduced":["2.0.0"],"last_affected":[],"package":"potato-annotation","purl":null,"source":"GHSA-q9m2-fhv9-3jcf"},{"ecosystem":"PyPI","fixed":["2.4.5"],"introduced":["2.0.0"],"last_affected":[],"package":"potato-annotation","purl":"pkg:pypi/potato-annotation","source":"GHSA-q9m2-fhv9-3jcf"}],"products":null,"published":"2026-05-08","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can bypass project boundary checks to access or modify files outside the intended directory due to flawed string-prefix validation.","url":"https://insights.sbomify.com/GHSA-q9m2-fhv9-3jcf/"}