{
  "metadata": {
    "report_type": "QWED_COMPREHENSIVE_AUDIT",
    "generated_at": "2025-12-01T05:10:03.335001",
    "version": "1.0"
  },
  "summary": {
    "timestamp": "2025-12-01T05:10:03.332915",
    "duration_seconds": 1.727868,
    "total_tests": 13,
    "passed": 9,
    "failed": 4,
    "pass_rate": 69.23076923076923,
    "by_priority": {
      "critical": {
        "total": 10,
        "passed": 7,
        "pass_rate": 70.0
      },
      "high": {
        "total": 3,
        "passed": 2,
        "pass_rate": 66.66666666666666
      },
      "medium": {
        "total": 0,
        "passed": 0,
        "pass_rate": 0
      }
    },
    "by_engine": {
      "code": {
        "total": 13,
        "passed": 9,
        "pass_rate": 69.23076923076923
      }
    }
  },
  "results": [
    {
      "test_id": "CODE_AST_001",
      "test_name": "Detect __import__() with user input",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": true,
      "expected_result": "CRITICAL - Dynamic import RCE",
      "actual_result": {
        "is_safe": false,
        "issues": [
          "Dangerous function: __import__"
        ],
        "detailed_issues": [
          {
            "severity": "CRITICAL",
            "message": "Dangerous function: __import__",
            "line": 3,
            "requires_manual_review": false,
            "remediation": "Avoid __import__() - use safer alternatives"
          }
        ],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 1,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 156.7685604095459,
      "timestamp": "2025-12-01T05:10:01.760813"
    },
    {
      "test_id": "CODE_AST_002",
      "test_name": "Detect getattr() with user input",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": false,
      "expected_result": "CRITICAL - Reflection allows arbitrary method execution",
      "actual_result": {
        "is_safe": true,
        "issues": [
          "Import of restricted module: os - verify usage is necessary",
          "Use of os.system detected - verify security context"
        ],
        "detailed_issues": [
          {
            "severity": "WARNING",
            "message": "Import of restricted module: os - verify usage is necessary",
            "line": 7,
            "requires_manual_review": true,
            "remediation": "Ensure module usage is validated and necessary for functionality"
          },
          {
            "severity": "WARNING",
            "message": "Use of os.system detected - verify security context",
            "line": 8,
            "requires_manual_review": true,
            "remediation": null
          }
        ],
        "requires_manual_review": true,
        "severity_summary": {
          "critical": 0,
          "warning": 2,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 167.6616668701172,
      "timestamp": "2025-12-01T05:10:01.929475"
    },
    {
      "test_id": "CODE_AST_003",
      "test_name": "Detect format string + eval RCE",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": true,
      "expected_result": "CRITICAL - eval with f-string allows code injection",
      "actual_result": {
        "is_safe": false,
        "issues": [
          "Dangerous function: eval"
        ],
        "detailed_issues": [
          {
            "severity": "CRITICAL",
            "message": "Dangerous function: eval",
            "line": 3,
            "requires_manual_review": false,
            "remediation": "Avoid eval() - use safer alternatives"
          }
        ],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 1,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 100.00252723693848,
      "timestamp": "2025-12-01T05:10:02.030420"
    },
    {
      "test_id": "CODE_AST_004",
      "test_name": "Detect exec() with user input",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": true,
      "expected_result": "CRITICAL - exec() allows arbitrary code execution",
      "actual_result": {
        "is_safe": false,
        "issues": [
          "Dangerous function: exec"
        ],
        "detailed_issues": [
          {
            "severity": "CRITICAL",
            "message": "Dangerous function: exec",
            "line": 3,
            "requires_manual_review": false,
            "remediation": "Avoid exec() - use safer alternatives"
          }
        ],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 1,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 139.59383964538574,
      "timestamp": "2025-12-01T05:10:02.171020"
    },
    {
      "test_id": "CODE_001",
      "test_name": "Detect eval() with user input",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": true,
      "expected_result": "CRITICAL - eval() with user input",
      "actual_result": {
        "is_safe": false,
        "issues": [
          "Dangerous function: eval"
        ],
        "detailed_issues": [
          {
            "severity": "CRITICAL",
            "message": "Dangerous function: eval",
            "line": 3,
            "requires_manual_review": false,
            "remediation": "Avoid eval() - use safer alternatives"
          }
        ],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 1,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 103.81555557250977,
      "timestamp": "2025-12-01T05:10:02.276152"
    },
    {
      "test_id": "CODE_002",
      "test_name": "Detect pickle.loads() RCE",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": true,
      "expected_result": "CRITICAL - pickle.loads()",
      "actual_result": {
        "is_safe": false,
        "issues": [
          "Import of dangerous module: pickle",
          "Dangerous function: pickle.loads"
        ],
        "detailed_issues": [
          {
            "severity": "CRITICAL",
            "message": "Import of dangerous module: pickle",
            "line": 2,
            "requires_manual_review": false,
            "remediation": "Use json or safer serialization instead"
          },
          {
            "severity": "CRITICAL",
            "message": "Dangerous function: pickle.loads",
            "line": 4,
            "requires_manual_review": false,
            "remediation": "Avoid pickle.loads() - use safer alternatives"
          }
        ],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 2,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 100.05927085876465,
      "timestamp": "2025-12-01T05:10:02.377215"
    },
    {
      "test_id": "CODE_CTX_001",
      "test_name": "Track user input through function boundaries",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": true,
      "expected_result": "CRITICAL - Command injection via tainted input",
      "actual_result": {
        "is_safe": false,
        "issues": [
          "Import of restricted module: subprocess - verify usage is necessary",
          "Command injection risk: subprocess with user-controlled arguments"
        ],
        "detailed_issues": [
          {
            "severity": "WARNING",
            "message": "Import of restricted module: subprocess - verify usage is necessary",
            "line": 10,
            "requires_manual_review": true,
            "remediation": "Ensure module usage is validated and necessary for functionality"
          },
          {
            "severity": "CRITICAL",
            "message": "Command injection risk: subprocess with user-controlled arguments",
            "line": 11,
            "requires_manual_review": false,
            "remediation": "Validate and sanitize all subprocess arguments, use absolute paths, avoid user input"
          }
        ],
        "requires_manual_review": true,
        "severity_summary": {
          "critical": 1,
          "warning": 1,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 98.14333915710449,
      "timestamp": "2025-12-01T05:10:02.475359"
    },
    {
      "test_id": "CODE_CTX_002",
      "test_name": "Detect taint through variable aliasing",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": true,
      "expected_result": "CRITICAL - shell=True with tainted input",
      "actual_result": {
        "is_safe": false,
        "issues": [
          "Import of restricted module: subprocess - verify usage is necessary",
          "Command injection risk: subprocess with user-controlled arguments"
        ],
        "detailed_issues": [
          {
            "severity": "WARNING",
            "message": "Import of restricted module: subprocess - verify usage is necessary",
            "line": 6,
            "requires_manual_review": true,
            "remediation": "Ensure module usage is validated and necessary for functionality"
          },
          {
            "severity": "CRITICAL",
            "message": "Command injection risk: subprocess with user-controlled arguments",
            "line": 7,
            "requires_manual_review": false,
            "remediation": "Validate and sanitize all subprocess arguments, use absolute paths, avoid user input"
          }
        ],
        "requires_manual_review": true,
        "severity_summary": {
          "critical": 1,
          "warning": 1,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 120.20182609558105,
      "timestamp": "2025-12-01T05:10:02.596504"
    },
    {
      "test_id": "CODE_CTX_003",
      "test_name": "Safe open() with hardcoded path",
      "engine": "code",
      "priority": "HIGH",
      "passed": true,
      "expected_result": "SAFE - Hardcoded path is safe",
      "actual_result": {
        "is_safe": true,
        "issues": [],
        "detailed_issues": [],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 0,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 164.89839553833008,
      "timestamp": "2025-12-01T05:10:02.762806"
    },
    {
      "test_id": "CODE_CTX_004",
      "test_name": "open() with variable path",
      "engine": "code",
      "priority": "HIGH",
      "passed": true,
      "expected_result": "WARNING - Variable path needs review",
      "actual_result": {
        "is_safe": true,
        "issues": [
          "File I/O with variable path - verify input validation"
        ],
        "detailed_issues": [
          {
            "severity": "WARNING",
            "message": "File I/O with variable path - verify input validation",
            "line": 3,
            "requires_manual_review": true,
            "remediation": "Ensure file path is validated and within allowed directory"
          }
        ],
        "requires_manual_review": true,
        "severity_summary": {
          "critical": 0,
          "warning": 1,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 145.20788192749023,
      "timestamp": "2025-12-01T05:10:02.909928"
    },
    {
      "test_id": "CODE_CRYPTO_001",
      "test_name": "Detect MD5 for password hashing",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": false,
      "expected_result": "CRITICAL - MD5 is cryptographically broken for passwords",
      "actual_result": {
        "is_safe": true,
        "issues": [],
        "detailed_issues": [],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 0,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 100.83913803100586,
      "timestamp": "2025-12-01T05:10:03.011766"
    },
    {
      "test_id": "CODE_CRYPTO_002",
      "test_name": "Detect hardcoded encryption keys",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": false,
      "expected_result": "CRITICAL - Hardcoded encryption key",
      "actual_result": {
        "is_safe": true,
        "issues": [],
        "detailed_issues": [],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 0,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 182.30557441711426,
      "timestamp": "2025-12-01T05:10:03.194980"
    },
    {
      "test_id": "CODE_CRYPTO_003",
      "test_name": "Detect SHA-256 without salt",
      "engine": "code",
      "priority": "HIGH",
      "passed": false,
      "expected_result": "WARNING - SHA-256 needs salt and key stretching",
      "actual_result": {
        "is_safe": true,
        "issues": [],
        "detailed_issues": [],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 0,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 133.9893341064453,
      "timestamp": "2025-12-01T05:10:03.330915"
    }
  ],
  "failures": [
    {
      "test_id": "CODE_AST_002",
      "test_name": "Detect getattr() with user input",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": false,
      "expected_result": "CRITICAL - Reflection allows arbitrary method execution",
      "actual_result": {
        "is_safe": true,
        "issues": [
          "Import of restricted module: os - verify usage is necessary",
          "Use of os.system detected - verify security context"
        ],
        "detailed_issues": [
          {
            "severity": "WARNING",
            "message": "Import of restricted module: os - verify usage is necessary",
            "line": 7,
            "requires_manual_review": true,
            "remediation": "Ensure module usage is validated and necessary for functionality"
          },
          {
            "severity": "WARNING",
            "message": "Use of os.system detected - verify security context",
            "line": 8,
            "requires_manual_review": true,
            "remediation": null
          }
        ],
        "requires_manual_review": true,
        "severity_summary": {
          "critical": 0,
          "warning": 2,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 167.6616668701172,
      "timestamp": "2025-12-01T05:10:01.929475"
    },
    {
      "test_id": "CODE_CRYPTO_001",
      "test_name": "Detect MD5 for password hashing",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": false,
      "expected_result": "CRITICAL - MD5 is cryptographically broken for passwords",
      "actual_result": {
        "is_safe": true,
        "issues": [],
        "detailed_issues": [],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 0,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 100.83913803100586,
      "timestamp": "2025-12-01T05:10:03.011766"
    },
    {
      "test_id": "CODE_CRYPTO_002",
      "test_name": "Detect hardcoded encryption keys",
      "engine": "code",
      "priority": "CRITICAL",
      "passed": false,
      "expected_result": "CRITICAL - Hardcoded encryption key",
      "actual_result": {
        "is_safe": true,
        "issues": [],
        "detailed_issues": [],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 0,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 182.30557441711426,
      "timestamp": "2025-12-01T05:10:03.194980"
    },
    {
      "test_id": "CODE_CRYPTO_003",
      "test_name": "Detect SHA-256 without salt",
      "engine": "code",
      "priority": "HIGH",
      "passed": false,
      "expected_result": "WARNING - SHA-256 needs salt and key stretching",
      "actual_result": {
        "is_safe": true,
        "issues": [],
        "detailed_issues": [],
        "requires_manual_review": false,
        "severity_summary": {
          "critical": 0,
          "warning": 0,
          "info": 0
        }
      },
      "error": null,
      "latency_ms": 133.9893341064453,
      "timestamp": "2025-12-01T05:10:03.330915"
    }
  ],
  "statistics": {
    "total_tests": 13,
    "passed_count": 9,
    "failed_count": 4,
    "latency": {
      "min_ms": 98.14333915710449,
      "max_ms": 182.30557441711426,
      "avg_ms": 131.8066853743333
    },
    "engines_tested": [
      "code"
    ],
    "priorities_tested": [
      "HIGH",
      "CRITICAL"
    ]
  }
}