possible HTTP header injection
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Invalid
|
Undecided
|
Unassigned | ||
openstack-secaudit |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
here is another one from Sebastian. This one wasn't tested and just an idea of an attack vector. What do you think about it?
Thanks!
Sebastian Krahmer 2012-05-16 10:24:54 CEST
I am not very familar with the GreenPile and web framework that the
proxy is using, but it seems like the proxy handler
unquotes a lot of user input from HTTP request:
class ObjectControlle
"""WSGI controller for object requests."""
server_type = _('Object')
def __init__(self, app, account_name, container_name, object_name,
[...]
And later on uses these _names unquoted and passes it to new HTTP
requests at various places, for example
in PUT requests via path_info and many more.
I expect that unquote() makes \r\n from %0d%0a etc, so eventually
you can inject your own headers in the newly formed request?
(depends on what the framework does), so you can pass any
HTTP request through the proxy to swift backend and trigger above
bugs.
Hmm, I don't think this vector is valid.
Even though you can inject \r\n in webob's PATH_INFO, it's not used as-is in real request headers, it gets quoted before it's put to good use:
>>> a='/%0d%0a' Request. blank(' i will be overridden by env', environ={}) 'PATH_INFO' ]=b localhost/ %0D%0A'
>>> b=urllib.unquote(a)
>>> r=webob.
>>> r.environ[
>>> r.path_info
'/\r\n'
>>> r.url
'http://
So you can't inject \r\n in the resulting request ?