Skip to content

Conversation

@sambostock
Copy link

@sambostock sambostock commented Feb 20, 2020

Passing strings to diff as unescaped shell arguments to printf can result in unexpected (and potentially exploitable) behaviour if the strings contain special characters, such as backticks (`).

This adds a basic test which replicates the bug, and replaces the use of JSON.stringify with a basic escapeShellArg function, adapted from StackOverflow.

It would probably be good to get review from someone with more security knowledge.

@coveralls
Copy link

coveralls commented Feb 20, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 47d92e9 on sambostock:fix-rce into 39a2290 on danday74:master.

@sambostock sambostock force-pushed the fix-rce branch 2 times, most recently from 235eb91 to 3daf143 Compare February 20, 2020 07:49
@sambostock sambostock requested a review from danday74 February 24, 2020 21:04
Passing strings to diff as unescaped shell arguments to printf can
result in unexpected (and potentially exploitable) behaviour if the
strings contain special characters, such as backticks (`).
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