-
-
Notifications
You must be signed in to change notification settings - Fork 38
Harden examiner test execution with canonical path validation and strict input handling-Pr 838 base Branch #847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
jorgemoralespou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @Srustisundar All looks fine except for the reformatting of existing code and change in formatting style. But we can fix that in a later PR, since we need to add global formatter
|
@GrahamDumpleton Are you ok with this PR? |
|
Yeah Thats totaly Fine |
|
On first visual pass, I see a few issues with the proposed changes. First it prohibits a test name including a slash ( The second is that it should not block test args which are an empty string as that is entirely valid. Also logging has been removed with something only being logged in some cases when errors occur. Because extra logging cannot be enabled later through config or other means, having general progress logging is important in debugging issues with examiner scripts. The various logging (which was removed), helped delineate in the logs when examiner test scripts were run so is easier to then work out what output to the log from an examiner script related to. So log messages about timeout settings, when test processes were spawned, exit codes etc, should be added back. One cannot just rely on messages only being returned in the json response as that means important information is lost from workshop session log. |
|
One thing to note about directory traversal via This doesn't mean someone couldn't try and target examiner URL directly using Anyway, since various changes were needed from original PR, I am doing it as a separate set of changes which I will commit and push. |
|
Another issue. Although desire that tests can be across sub directories, the URL path handler match string didn't allow that, so need to update that to match whole trailing path of the URL after prefix. |
|
My variant of PR with changes mentioned above, as well as allowing new capability of allowing examiner scripts to be bundled with extension packages. |
|
@Srustisundar Can you validate the above mentioned PR #852 in your static analysis tool, so it complies with your requirements, since we would rather merge the one done by @GrahamDumpleton after a thorough analysis of the code and functionality. We don't want to affect existing users or change expected functionality. |
3.Resolved executable paths to their canonical (real) filesystem paths before execution.
Why this was done
Static analysis flagged the previous implementation due to potential ambiguity around child process execution paths.
Although practical exploitation was already constrained, this hardening removes any remaining doubt by making all trust boundaries explicit also increases the veracode security score