Skip to content

fix(security): Resolve false-equivalency capture in LHS assignment taint tracking #123

Closed

Description

@squid-protocol

The SecurityLens module currently uses a naive string match ("=" in line) to isolate the Left-Hand Side (LHS) of a variable assignment for downstream taint tracking. This creates a catastrophic false-equivalency capture when evaluating comparison operators (e.g., if (status === 200) or if (x <= 5)), causing the engine to falsely flag structural keywords (like if) as tainted variables and triggering false-positive RCE/Injection alerts across the entire file.

Proposed Fix:
Implement a bounded regex check re.search(r"[=!<>]=", line) before attempting assignment splitting to safely ignore lines containing standard comparison operators.

Change this:

                # Scenario B: Left-Hand Side (LHS) Assignment Extraction
                if has_io or has_llm:
                    assign_op = ":=" if ":=" in line else "=" if "=" in line else None
                    if assign_op:
                        lhs = line.split(assign_op)[0]

Activity

  1. added
    bug
    data-integrity
    on Jul 6, 2026
  2. squid-protocol commented on Jul 6, 2026

    @squid-protocol
    OwnerAuthor

    closed with #124

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

    bugdata-integrity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions