Skip to content

Harden SWE agent test file parsing#1800

Open
fallintoplace wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
fallintoplace:fix/swe-test-file-parser
Open

Harden SWE agent test file parsing#1800
fallintoplace wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
fallintoplace:fix/swe-test-file-parser

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • replace eval() when decoding selected_test_files_to_run with JSON parsing plus a constrained ast.literal_eval() compatibility fallback
  • validate that the decoded value is a list of strings before building the eval harness command
  • shell-quote the joined test file argument so malicious filenames cannot break out of run_script.sh

Root cause

The NV-internal SWE harness treated dataset-provided selected_test_files_to_run metadata as executable Python. That let a malformed or malicious dataset row run arbitrary code in the agent process before test execution even started.

Validation

  • uv run --extra dev python -m pytest responses_api_agents/swe_agents/tests/test_app.py

@copy-pr-bot

copy-pr-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@nemo-automation-bot nemo-automation-bot Bot added the community-request Issue reported or requested by someone from the community label Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-request Issue reported or requested by someone from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant