-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add text pastebin #19
Comments
As a workaround until this feature is officially added, Trifecta can also be used as a plain-text pastebin by including a carriage return in the claimed MIME type, like so: curl -H "Cookie: session=..." -F $'[email protected];type=image/\r' http://localhost:3456/upload This submits paste.txt as the "image", without a caption (so the inverse of the above). To paste stdin, replace Trifecta will respond with the image ID; the link to share would be http://localhost:3456/i/$id which serves the pasted snippet with the |
joking aside, do you think this is a bug here or over at cpp-httplib? that it doesn't escape mime-type? |
I had expected Trifecta to refuse this on upload. From the blog posts, I understand that the app does not want to use an image library to validate that the images it receives are indeed valid images in the claimed format, as users might (accidentally?) upload files that exploit vulnerabilities in such a library. However, the app could still have a hard-coded allowlist of the claimed content types that it is willing to accept and serve (so exactly One could argue that cpp-httplib should signal error if this happens, but one could also argue that it's the caller's responsibility to not attempt calling this with strings containing carriage return characters. I do not know HTTP well enough to say whether there would be a way for httplib to escape a carriage return here. |
This is actually nearly there, just a caption without an image.
Might ponder some javascript powered pretty printing later. Or not.
The text was updated successfully, but these errors were encountered: