Repository navigation
Conversation
trufae
pushed a commit
that referenced
this pull request
Oct 30, 2026
The log-file filename came from the agent, which runs inside the target, so a hostile process could run commands, append to files or open connections on the host. Track file.log on the host side instead and feed '|cmd' messages to the program stdin rather than through the shell. Supersedes #898
Member
|
this solves part of the problem i was digging deeper and pushed a better fix in master. thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey @radare ,
When file.log starts with
|, every trace message goes to that program through r_sys_cmdf inside double quotes (src/io_frida.c:1915-1916). The message is escaped with r_str_escape, it handles quotes and backslashes but not$and backticks, so the shell still expands them.Trace messages carry data from the target, for example the strings :dtr reads from registers (trace.ts:343) or
zargs in :dtf (trace.ts:543). So if you trace with:e file.log=|tee -a out.txtand the app passes a string like$(id)to the traced function, that command runs on your machine.This PR uses r_str_escape_sh, it is made for this case and also escapes
$, backtick and!. The program now gets newlines, tabs, colors and UTF-8 as they are instead of\n,\tand\xNNtext with colors removed, and!now arrives as\!.Thanks