Skip to content

harden: add path validation in cmp_with_scann.py... - #5519

Open
anupamme wants to merge 1 commit into
facebookresearch:mainfrom
anupamme:fix-repo-faiss-utils-custom-path-traversal-open-benchs-bench-all-ivf-cmp-with-scann-py
Open

harden: add path validation in cmp_with_scann.py...#5519
anupamme wants to merge 1 commit into
facebookresearch:mainfrom
anupamme:fix-repo-faiss-utils-custom-path-traversal-open-benchs-bench-all-ivf-cmp-with-scann-py

Conversation

@anupamme

Copy link
Copy Markdown

Summary

Harden input handling in benchs/bench_all_ivf/cmp_with_scann.py (flagged by semgrep).

Vulnerability

Field Value
ID utils.custom.path-traversal-open
Severity HIGH
Scanner semgrep
Rule utils.custom.path-traversal-open
File benchs/bench_all_ivf/cmp_with_scann.py:105
Assessment Defensive hardening

Description: User-controlled input used in file path for open() without sanitization. This can allow path traversal attacks to read arbitrary files.

Threat Model Context

This is a Python library - vulnerabilities affect applications that import this code.

Changes

  • benchs/bench_all_ivf/cmp_with_scann.py

Behavior Preservation

The change is scoped to 1 file on the vulnerable path; it only tightens handling of untrusted input and leaves valid inputs unaffected.


This patch removes an exploit primitive — a code pattern that, while not independently exploitable today, could be chained with other weaknesses by automated exploit-development tooling. Proactive removal of such primitives raises the bar against increasingly capable automated attack tools.


Automated security fix by OrbisAI Security

User-controlled input used in file path for open() without sanitization
Addresses utils.custom.path-traversal-open
@meta-cla meta-cla Bot added the CLA Signed label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant