Skip to content
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

Address Windows-shell fuzz crashes #478

Merged
merged 6 commits into from
Oct 16, 2022

Conversation

ericcornelissen
Copy link
Owner

@ericcornelissen ericcornelissen commented Oct 15, 2022

Relates to #463


Summary

This is to address the fuzz crash (9729c65) found by this nightly CI run - additionally it addresses another fuzz crash (4af9014) found as part of this Pull Request.. Given the nature of these crashes, it is suspected there's something wrong with the fuzz logic rather than the source code.

Add an item that cause crashes when fuzzing cmd.exe in the
repository in the CI at [1]. Based on local testing this also affects
PowerShell.

--
1. 6c31238
@ericcornelissen ericcornelissen added the test Relates to testing label Oct 15, 2022
Update the arg preparation when fuzzing cmd.exe by accounting for newly
stripped characters by Shescape when preparing arguments containing
forward slashes. In particular in addition to `\0`, Shescape also strips
`\u0008`, `\u001B`, and `\u009B`.

Accordingly, fix the comment explaining to replacement as it incorrectly
claims that `\0` is ignored (while in fact it's Shescape that removes
it).
Add an item that cause crashes when fuzzing PowerShell in the
repository in the CI at [1]. Based on local testing this does not affect
cmd.exe

--
1. 6c31238
Update the arg preparation when fuzzing PowerShell by accounting for
newly stripped characters by Shescape when preparing arguments
containing forward slashes. In particular in addition to `\0`, Shescape
also strips `\u0008`, `\u001B`, and `\u009B`.

Accordingly, fix comments explaining the replacements as they
incorrectly claim that `\0` is ignored (while in fact it's Shescape that
removes it).
@ericcornelissen ericcornelissen marked this pull request as ready for review October 16, 2022 15:50
Improve how the carriage return character is considered when preparing
arguments for PowerShell. In particular, rather than only considering it
at the end of the argument, consider it any time it's not followed by a
line feed.
@ericcornelissen ericcornelissen merged commit 94bee88 into main Oct 16, 2022
@ericcornelissen ericcornelissen deleted the investigate-win-fuzz-crashes branch October 16, 2022 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Relates to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant