Skip to content

The Supply Chain Firewall is failing to enforce behavioral density thresholds because the calculated risk exposures always return 0.0%. #156

Closed

Description

@squid-protocol

Description

The Supply Chain Firewall is failing to enforce behavioral density thresholds (e.g., Hidden Malware, Logic Bombs) because the calculated risk exposures always return 0.0%.

Root Cause

There is a schema mismatch between the Phase 1 RAM graph generator and the Security Lens risk evaluator:

  1. In galaxyscope.py (Phase 1), security scan results are intentionally prefixed with sec_ before being appended to the equations dictionary (e.g., sec_high_risk_execution, sec_reflection_metaprogramming).
  2. In supply_chain_firewall.py, the firewall extracts this equations dictionary and passes it directly into security.evaluate_risk().
  3. In security_lens.py, the evaluate_risk() method attempts to fetch the counts using the raw, un-prefixed keys (e.g., aggregated_hits.get("reflection_metaprogramming", 0)).

Because the keys don't match, the risk evaluator defaults every threat count to 0, causing the firewall to silently bypass high-risk files.

Affected Files

  • gitgalaxy/tools/supply_chain_security/supply_chain_firewall.py
  • gitgalaxy/security/security_lens.py
  • gitgalaxy/galaxyscope.py

Suggested Fix

The most isolated fix is to intercept and sanitize the dictionary inside the firewall before passing it to the evaluator.

In supply_chain_firewall.py, strip the sec_ prefix from the keys when cloning the dictionary for the sandbox:

        # Clone the dictionary and strip the 'sec_' prefix for the security evaluator
        local_counts = {}
        for k, v in equations.items():
            clean_key = k[4:] if k.startswith("sec_") else k
            local_counts[clean_key] = v

Activity

  1. added
    supply-chain
    bug
    threat: false-negative
    priority: critical
    on Jul 11, 2026
  2. added this to the v2.4.0 milestone on Jul 11, 2026
  3. added a commit that references this issue on Jul 11, 2026
    524c1f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: criticalsupply-chainthreat: false-negative

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions