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

stderr should not be copied into the output file #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spixi
Copy link

@spixi spixi commented Feb 19, 2017

Copying stderr into the output file may cause invalid files and also expose information about the server. stderr must not be copied into the output file.
See here for an invalid jpg which was generated by simple-captcha. After removing the trailing payload up the the JFIF magic string, the file is actually a valid jpeg containing a working captcha. https://gist.github.com/spixi/fccdd98e51336e0e9230b2a2741dac56

Copying stderr into the output file may cause invalid files and also expose information about the server. stderr must not be copied into the output file.
See here for an invalid jpg which was generated by simple-captcha. After removing the trailing payload up the the JFIF magic string, the file is actually a valid jpeg containing a working captcha. https://gist.github.com/spixi/fccdd98e51336e0e9230b2a2741dac56
@zealot128
Copy link
Member

That's true, the command handling is not very safe.

What happens now, when there is an error with processing, like missing Imagemagick version, disk full etc? Does that error get somehow passed upon?

I think the best way would be, to use a full-blown command wrapper, like popen3 to capture stdout/sterr independently though

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.

None yet

2 participants