-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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 exploit module for CUPS shellshock #4050
Conversation
# The print job triggers execution of the bash filter | ||
# which executes the payload in the env vars. | ||
res = print_test_page(printer_name) | ||
if !res || res.code != 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this be clearer (assuming I get the logic right) if it were
unless res && res.code == 200
return print_error(blah)
end
Cool submission, thanks! |
Has anyone tested against the OSX version of CUPS? |
Nice. This was the first thing I looked at, since i knew the http server in cups passes the request through env variables (but uses posix spawn process or execve so I stopped looking). Good idea on creating a printer. If you know (or want to try a dictionary attack on) the username/password you could also serve this exploit to a browser to run against the loopback. There is no csrf token that i can see, besides the |
Err ignore that ^ this wouldn't work in a browser, not sure what I was thinking, you'd have to steal that cookie and put it in a separate request parameter :) |
554935e adds
|
@jvennix-r7 you could steal the cookie with XSS in CUPS 1.6.4 if the user is authenticated. |
@bcoles: Tell me when you want this landed, and we can do that. It's kinda sorta a big thing. ;) You can PR further changes afterward. Sound good? |
@wvu-r7 I've removed CVE-2014-6278 for now. Ready to land. |
What's wrong with CVE-2014-6278? :P |
Corresponded via e-mail. CVE-2014-6278 support is unreliable. This looks good to go. Thanks, @bcoles! P.S. Thanks to @kernelsmith for the awesome review. :) |
Bashbleeded!!!!!!!!!!!
@wvu-r7 I removed CVE-2014-6278 as the payload was broken. I've added a working payload for CVE-2014-6278 in #4093. CVE-2014-6278 appeared unreliable as it doesn't work on older versions of bash prior to ~4.2.
|
@bcoles: Ah, that's what you meant by unreliable. That's why we used From http://lcamtuf.blogspot.com/2014/10/bash-bug-how-we-finally-cracked.html:
FWIW, CVE-2014-6271 works on one of my test boxes, but CVE-2014-6278 doesn't work. Same reason. |
Add CUPS Filter Bash Environment Variable Code Injection exploit module.
The PRINTER_INFO and PRINTER_LOCATION printer properties (set when adding a printer to CUPS) are exported to environment variables when processing a print job. As such, it is possible for an authenticated CUPS user to add a printer with a shellshock payload in either of these properties then trigger the payload by queuing a print job.
Tested
Check
Run