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

php_echo is vulnerable to format string attacks! #5

Open
wizzwizz4 opened this issue Feb 21, 2020 · 1 comment
Open

php_echo is vulnerable to format string attacks! #5

wizzwizz4 opened this issue Feb 21, 2020 · 1 comment

Comments

@wizzwizz4
Copy link

solder::zend::php_echo is implemented as:

php_printf(c_message.as_bytes_with_nul().as_ptr() as *const i8);

but it should be something like:

php_printf(c_str!("%s"), c_message.as_bytes_with_nul().as_ptr() as *const i8);

(Please check that this works before using it; it's untested unsafe code interacting with C variadic arguments!)

@wizzwizz4
Copy link
Author

wizzwizz4 commented Feb 26, 2020

I tested this code in my fork (SnAgCu, not the one on GitHub). I can't promise it is safe, but it prints the output and isn't vulnerable against format string attacks, so I'm tentatively calling it a success.

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

No branches or pull requests

1 participant