WIP: OSCMD2:Add oscmdpatches report for Command Injection analysis#280
Open
dvorak42 wants to merge 4 commits into
Open
WIP: OSCMD2:Add oscmdpatches report for Command Injection analysis#280dvorak42 wants to merge 4 commits into
dvorak42 wants to merge 4 commits into
Conversation
Contributor
Author
waskyo
reviewed
Jun 15, 2026
waskyo
left a comment
Collaborator
There was a problem hiding this comment.
some questions and minor comments!
| return True | ||
| return target.name in xtargets | ||
|
|
||
|
|
Collaborator
There was a problem hiding this comment.
nit: one too many empty lines
| if include_target(calltgt): | ||
| if calltgt.is_so_target: | ||
| so_function = cast("SOFunction", cast("StubTarget", calltgt).stub) | ||
| for po in instr.proofobligations(): |
Collaborator
There was a problem hiding this comment.
how about moving this check to an in-function util function like include_target? That way the loop is not so unwieldy.
|
|
||
| patch_records = [] | ||
|
|
||
| for construction_iaddr in os_cmd_construction.keys(): |
Collaborator
There was a problem hiding this comment.
should we process these in sorted order like we do in report_patch_candidates?
| pc_content["annotation"] = instr.annotation | ||
| pc_content["faddr"] = faddr | ||
| pc_content["iaddr"] = instr.iaddr | ||
| if instr.iaddr in os_cmd_delegations: |
Collaborator
There was a problem hiding this comment.
when could this check be false?
| pc_content["faddr"] = faddr | ||
| pc_content["iaddr"] = instr.iaddr | ||
| if instr.iaddr in os_cmd_delegations: | ||
| pc_content["os-iaddrs"] = os_cmd_delegations[instr.iaddr] |
Collaborator
There was a problem hiding this comment.
what does the key name (os-iaddrs) translate to?
| buffersize, sizeorigin = calculate_buffer_size(stackframe, argoffset, instr) | ||
| fn_args.append({"type": "pointer", "max-length": buffersize, "size-origin": sizeorigin}) | ||
| else: | ||
| fn_args.append({"type": "unknown"}) |
Collaborator
There was a problem hiding this comment.
i think we should log a warning here? (which would normally cause the rest of the pipeline to fail)
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.
No description provided.