Skip to content

Security: flash() keeps Tcl out of OpenOCD's program command (SDK 2.13.17) - #80

Merged
wardviaene merged 1 commit into
mainfrom
openocd-args-safe
Nov 14, 2026
Merged

wardviaene merged 1 commit into
mainfrom
openocd-args-safe

Conversation

@wardviaene

Copy link
Copy Markdown
Member

OpenOCD runs the program <file> <load_address> ... string as Tcl, so [exec ...] in a file name or load address ran a command on the machine running the flash. The embeddedci server runs this for the AI tab, so it was a server-side command injection (the server now also checks the arguments itself).

  • The firmware path goes in braces (no Tcl substitution); Windows backslashes become forward slashes; a path with a brace is refused.
  • load_address must be a number (hex or decimal).
  • Tests for both.

The MCP 2.13.17 (requiring this SDK) follows in its own PR once this is on PyPI.

🤖 Generated with Claude Code

…3.17)

The firmware path goes in braces and load_address must be a number, so a file name or address like [exec ...] cannot run a command through OpenOCD's Tcl. Windows paths are passed with forward slashes; a path with a brace is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene merged commit 7f23355 into main Nov 14, 2026
20 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.

1 participant