Skip to content

Conversation

@bgamari
Copy link
Contributor

@bgamari bgamari commented Apr 10, 2024

Add documentation and implement the escaping logic for % noted in https://flatt.tech/research/posts/batbadbut-you-cant-securely-execute-commands-on-windows/.

Another aspect of the BatBadBut vulnerability that the previous patch
did not address is the fact that `%` cannot be easily escaped in a
double-quoted string. The vulnerability discussion suggests
transliterating `%` as `%%cd:~,%`, which should evaluate to an empty
string assuming that the `DelayedExpansion` registry setting is
disabled.

Here I have implemented this additional mitigation.
@bgamari bgamari merged commit 142a7eb into haskell:master Sep 6, 2024
@bgamari bgamari deleted the wip/windows-2 branch September 6, 2024 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants