cyralinc / approzium

Approzium allows a cloud service to authenticate to a database without ever having access to its password
https://approzium.com
Apache License 2.0
55 stars 7 forks source link

Increase response verification #205

Closed tyrannosaurus-becks closed 4 years ago

tyrannosaurus-becks commented 4 years ago

This PR is in relation to this article describing a security vulnerability in Vault.

We have similar code, so I checked it through and found that we're actually not vulnerable to the same issue because we have been checking the Action header all along. Just in case, though, I decided to tighten up checking what's in the response we get from AWS to make sure it doesn't have an unexpected content-type header. Also, just in case there's some other header that we don't know about that could be used to slip in JSON, I added a check to make sure the body doesn't look like it could contain JSON.