fix: wire validate_command_network_egress into execute_task#631
Open
ionfwsrijan wants to merge 3 commits into
Open
fix: wire validate_command_network_egress into execute_task#631ionfwsrijan wants to merge 3 commits into
ionfwsrijan wants to merge 3 commits into
Conversation
The function validate_command_network_egress() was defined in validation.py but never imported or invoked anywhere in the execution pipeline. This meant secondary plugin fields like proxy, virtual_host, config_file, and user_agent could contain arbitrary network destinations that bypassed target validation entirely. Now validate_command_network_egress() is called right after the command is built and before Docker sandboxing, ensuring every command argument is inspected for network destinations against the safe-mode + network policy configuration. Fixes utksh1#614
8cb3b8d to
06d0663
Compare
06d0663 to
c610ba5
Compare
Contributor
Author
|
@utksh1 You may review and merge this |
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
The function
validate_command_network_egress()invalidation.pyinspects every command argument for network destinations against the safe-mode + network policy configuration. However, it is never imported or invoked anywhere in the execution pipeline (executor.pyorroutes.py). While the primarytargetfield is validated, secondary plugin fields likeproxy,virtual_host,config_file, anduser_agentcan contain arbitrary network destinations that bypass target validation entirely.Fix: wire
validate_command_network_egress()intoexecutor.py'sexecute_task()right after the command is built and before Docker sandboxing, ensuring every command argument is validated.Related Issues
validate_command_network_egressis Dead Code — Secondary Fields Bypass Target Validation #614Type of Change
How Has This Been Tested?
The
validate_command_network_egressfunction is now called afterplugin_manager.build_command()completes and before subprocess execution. If any argument fails validation, aValueErroris raised, preventing task execution.Checklist