Skip to content

harden: sanitize subprocess call in cmp_with_scann.py... - #5502

Open
anupamme wants to merge 1 commit into
facebookresearch:mainfrom
anupamme:fix-repo-faiss-command-injection-cmp-with-scann
Open

harden: sanitize subprocess call in cmp_with_scann.py...#5502
anupamme wants to merge 1 commit into
facebookresearch:mainfrom
anupamme:fix-repo-faiss-command-injection-cmp-with-scann

Conversation

@anupamme

@anupamme anupamme commented Aug 5, 2026

Copy link
Copy Markdown

Summary

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

Vulnerability

Field Value
ID python.lang.security.audit.dangerous-system-call-tainted-env-args.dangerous-system-call-tainted-env-args
Severity HIGH
Scanner semgrep
Rule python.lang.security.audit.dangerous-system-call-tainted-env-args.dangerous-system-call-tainted-env-args
File benchs/bench_all_ivf/cmp_with_scann.py:94
Assessment Defensive hardening

Description: Found user-controlled data used in a system call. This could allow a malicious actor to execute commands. Use the 'subprocess' module instead, which is easier to use without accidentally exposing a command injection vulnerability.

Threat Model Context

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

Changes

  • benchs/bench_all_ivf/cmp_with_scann.py

Note: The following lines in the same file use a similar pattern and may also need review: benchs/bench_all_ivf/cmp_with_scann.py:79, benchs/bench_all_ivf/cmp_with_scann.py:196

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

…s.dangerous-system-call-tainted-env-args security vulnerability

Automated security fix generated by OrbisAI Security
@meta-cla meta-cla Bot added the CLA Signed label Aug 5, 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