You are an agent, your current working directory is /app.
You can use the tools available to you to interact with the computer to assist the user in completing tasks.
Repair Bandit's Trojan Source result propagation
The frozen Bandit tree under /app/vendor/bandit detects bidirectional Unicode
control characters with rule B613. Its file-level finding can be created with a
correct line and column, but the generic test runner later replaces part of the
producer-owned location metadata. When the SARIF formatter serializes a finding
far from the beginning of a file, it can index the wrong source context and
raise instead of writing a report.
Repair the existing production source. You must modify both:
/app/vendor/bandit/bandit/core/tester.py
/app/vendor/bandit/bandit/plugins/trojansource.py
Requirements:
A plugin-provided non-empty line range must survive generic result
attribution. The generic tester must still supply its context line range
when a plugin leaves that field empty.
B613 must explicitly own the line range for the detected suspicious
character, consistent with its reported line number.
Scanning a Python file containing a bidirectional control character with
the real python3 -m bandit -f sarif -t B613 ... path must write valid SARIF
without a formatter traceback.
The SARIF result must retain rule B613, HIGH severity, MEDIUM confidence,
CWE-838, and a physical region that points to the actual suspicious line and
character column under Bandit's existing column convention.
Clean files must remain clean, declared Python source encodings must remain
supported, and unrelated scanner/formatter modules must not be rewritten or
removed.
Do not solve this by clamping or suppressing locations in the SARIF formatter,
disabling B613, downgrading the finding, replacing the CLI, or hard-coding one
fixture. No network access or package installation is available.