Skip to content

fix: block path traversal in runtime file read/write paths#539

Merged
pradeeban merged 1 commit intoControlCore-Project:devfrom
avinxshKD:fix/path-boundary-guards
Apr 5, 2026
Merged

fix: block path traversal in runtime file read/write paths#539
pradeeban merged 1 commit intoControlCore-Project:devfrom
avinxshKD:fix/path-boundary-guards

Conversation

@avinxshKD
Copy link
Copy Markdown
Contributor

Fixes #536

Runtime file I/O was trusting name when building port paths, so ../ could escape the intended port directory. Added strict path-boundary checks before file reads/writes.

changes:

  • core runtimes: concore_base.py, concore.java, concoredocker.java
  • duplicated legacy/sample runtime copies (concore2.py variants) updated with the same guard pattern
  • regression coverage for traversal cases in Python + Java tests

Behavior change is only for invalid filenames. Valid workflows are unchanged.

@avinxshKD
Copy link
Copy Markdown
Contributor Author

@pradeeban @Rahuljagwani @mayureshkothare pls take a look, also added the same guard to legacy/sample runtime copies too, since they reuse the same file I/O path construction and would otherwise keep the traversal surface open.

This should be good for consistency and safety across core and sample runtimes.

@pradeeban pradeeban merged commit 12971f7 into ControlCore-Project:dev Apr 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants