Site icon API Security Blog

Exposure of Sensitive Information to an Unauthorized Actor in httpie

Impact HTTPie have the practical concept of sessions, which help users to persistently store some of the state that belongs to the outgoing requests and incoming responses on the disk for further usage. As an example, we can make an authenticated request and save it to a named session called api: bash $ http –session api -a user:pass pie.dev/basic-auth/user/pass json { "authenticated": true, "user": "user" } Since we have now saved the authentication data to that session, we won‘t have to enter it again and again on every invocation. We can simply reference the session, and HTTPie will use the saved state directly from it: bash $ http –session api pie.dev/basic-auth/user/pass json { "authenticated": true, "user": "user" } One particular use case of these sessions is storing cookies (commonly referred to as a Cookie Jar). If a response has a Set-Cookie header, HTTPie will parse it and store the actual cookie in the session. And from that point on, all outgoing requests will attach that cookie (in the form of a Cookie header). This is extremely useful, especially when you are dealing with websites which manage their own state on the client-side through cookies. bash $ http -F –session jar pie.dev/cookies/set/x/y json { "cookies": { "x": "y" } } Before 3.1.0, HTTPie didn‘t distinguish between cookies and hosts they belonged. This behavior resulted in the exposure of some cookies when there are redirects originating from the actual host to a…

Exit mobile version