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

Insufficient escaping in code generator #26

Closed
kornelski opened this issue Aug 18, 2020 · 1 comment · Fixed by #31
Closed

Insufficient escaping in code generator #26

kornelski opened this issue Aug 18, 2020 · 1 comment · Fixed by #31

Comments

@kornelski
Copy link
Contributor

Code generator doesn't escape strings:

https://github.com/rustyhorde/vergen/blob/master/src/output/codegen.rs#L23

Adding quotes around the value is not sufficient - the value could contain quotes or end with backslash, and cause the value to become arbitrary Rust source code.

With the current set of inputs I don't think it's a real vulnerability, but it does increase risk of creating one if some more arbitrary build info was added in the future.

@teor2345
Copy link
Contributor

teor2345 commented Dec 4, 2020

Rather than trying to escape string terminators and backslashes, it would be more reliable to just delete those characters.

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 a pull request may close this issue.

2 participants