fix(dynamic-agents): constrain curl request arguments - #2366
Open
sriaradhyula wants to merge 2 commits into
Open
fix(dynamic-agents): constrain curl request arguments#2366sriaradhyula wants to merge 2 commits into
sriaradhyula wants to merge 2 commits into
Conversation
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Contributor
|
✅ No proprietary content detected. This PR is clear for review! |
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Contributor
ℹ️ Branch is behind
|
sriaradhyula
marked this pull request as ready for review
August 20, 2026 17:23
subbaksh
approved these changes
Aug 20, 2026
subbaksh
reviewed
Aug 20, 2026
Comment on lines
+144
to
+152
| def _validate_curl_option_value(option: str, value: str) -> str | None: | ||
| """Reject curl option values that can make curl read local files.""" | ||
| if option not in _CURL_FILE_CAPABLE_OPTIONS: | ||
| return None | ||
|
|
||
| stripped_value = value.lstrip() | ||
| if stripped_value.startswith("@") or (option == "--data-urlencode" and "@" in value): | ||
| return f"Option '{option}' cannot read request data from a local file" | ||
| return None |
Collaborator
There was a problem hiding this comment.
We should return a agent friendly error instead of None
like This curl argument is forbidden for security reasons.
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.
Description
Make the built-in curl tool use a defined request interface instead of forwarding unrestricted command-line arguments.
Type of Change
Pre-release Helm Charts (Optional)
No chart changes.
Checklist
Validation