You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have stumbled upon a way to trigger a panic using the /auth/approle/login API endpoint of Vault using a simple malformed request.
Describe the bug
In a request to /auth/approle/login, setting either the role_id or secret_id parameters to an object (i.e. {}) rather than a string triggers the issue. This results in the connection being closed to the client without a response being sent. On the server side, a log message beginning with the following (followed by a stack trace) is seen:
Send a malformed request with either role_id or secret_id set to {}, for example:
$ curl \
--request POST \
--header "Content-Type: application/json" \
--data '{"role_id": {}, "secret_id": ""}' \
http://localhost:8200/v1/auth/approle/login
curl: (52) Empty reply from server
Observe connection closing before a response is received by the client. Also observe panic and stack trace (as shown above) in the Vault logs.
Expected behavior
I would expect some kind of 4xx error about a malformed request and no messages in the vault logs.
Environment:
Vault v1.17.1 (b8ab595), built 2024-06-25T16:33:25Z
Ubuntu 22.04.4 LTS, x86_64
Additional context
Since this causes a panic I initially reported this to the Hashicorp security address due to the hypothetical possibility of using this kind of error as the basis for an exploit. They were contented that this particular bug was not likely to have any potential security impact, hence this report being posted publicly here.
The text was updated successfully, but these errors were encountered:
I have stumbled upon a way to trigger a panic using the /auth/approle/login API endpoint of Vault using a simple malformed request.
Describe the bug
In a request to
/auth/approle/login
, setting either therole_id
orsecret_id
parameters to an object (i.e.{}
) rather than a string triggers the issue. This results in the connection being closed to the client without a response being sent. On the server side, a log message beginning with the following (followed by a stack trace) is seen:Full output with stack trace (click to expand)
I have not observed any other side effects (e.g. the server remains up and responsive to further requests).
To Reproduce
Start up a vault instance, e.g.:
Enable the AppRole auth method:
Send a malformed request with either
role_id
orsecret_id
set to{}
, for example:Observe connection closing before a response is received by the client. Also observe panic and stack trace (as shown above) in the Vault logs.
Expected behavior
I would expect some kind of 4xx error about a malformed request and no messages in the vault logs.
Environment:
Additional context
Since this causes a panic I initially reported this to the Hashicorp security address due to the hypothetical possibility of using this kind of error as the basis for an exploit. They were contented that this particular bug was not likely to have any potential security impact, hence this report being posted publicly here.
The text was updated successfully, but these errors were encountered: