Uploaded image for project: 'AI Platform Core Components'
  1. AI Platform Core Components
  2. AIPCC-9939

[BOT][Security] CWE-78 in compiler_bisector.py:702

    • False
    • Hide

      None

      Show
      None
    • False

      Vulnerability Details

      CWE Type(s): CWE-78
      Severity: MEDIUM
      Team: PyTorch Compile

      Location

      • File: torch/_inductor/compiler_bisector.py
      • Lines: 702

      Description

      Command Injection via unvalidated run_cmd from sys.argv

      run_cmd constructed from sys.argv[2:] without validation before passing to subprocess.run

      Impact

      run_cmd constructed from sys.argv[2:] without validation before passing to subprocess.run. While sys.argv is a list (safer than strings), the lack of validation could allow empty commands or unexpected command structures that could cause security issues or denial of service.

      Root Cause

      run_cmd constructed from sys.argv[2:] without validation before passing to subprocess.run

      Fix Status

      MR Link: https://gitlab.com/redhat/rhel-ai/team-pytorch/pytorch/-/merge_requests/167
      Fix Branch: security-fix-cwe78-compiler-bisector
      Status: IMPLEMENTED

      Related Exploit Files

      • test_command_injection_compiler_bisector_subprocess.py

      Exploit Code Sample

      # Security regression test that validates the fix
      # Test file: test_command_injection_compiler_bisector_subprocess.py
      
      # The test verifies:
      # 1. Proper input validation
      # 2. Safe subprocess execution
      # 3. Protection against command injection attacks
      

      References


      Generated by CI Security Bot on 2026-02-03

              Unassigned Unassigned
              pytorch-engineering PyTorch Engineering
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: