API Last Request Date/Time Not Updating
The 'Last request' field for API tokens never updates from 'Never' even after the token is used, so administrators cannot see when a token was last used. This undermines a security feature that could help detect unauthorised token use.
- Triaged in 16 days
- Fixed in 18 days
- Disclosed after 2.1 years
Hi All, I believe I've found a minor vulnerability with regards to your API last request date/time. However, I could not find any documentation on what this value is supposed to represent / when it should be relied on so I debated reporting this but figured it might in fact be an issue.
##Description
After creating an API token, on the API administration page, there is a field, Last request. When I created the token, the value was Never. However, after playing with the API, making GET, POST and PUT requests, the last request time never gets updated, it appears to be permanently Never.
In the POC here, you can see that I've received notifications that my API user has performed actions via my notifications popup but the last request remains Never.
I should also note that my program is still in sandbox in the event that has some impact on the functionality though I think that would be an odd cause for this. I also have two tokens, one of which I used yesterday just for reading but still says never.
##Vulnerability While I believe this is minor, I'm reporting because I would think this value was created on the administration page as an added security feature to let administrators know when the API token has last been used. If I'm correct, never updating it would undermine that purpose and create a false sense of security for any administrators relying on the value.
##Steps to reproduce
- Create a new sandbox program
- Go to the program settings --> API, the url will be https://hackerone.com/PROGRAM_HANDLE/api
- Create a token and assign the API user to standard user and admin (or at least I did)
- Perform some API curl requests -- I used read report, assign report and program details
- Come back to the H1 UI and confirm you got the notifications for the API assigning a report and creating a comment
- Reload the /PROGRAM_HANDLE/api page and you'll notice that the last request value has not been updated.
Please let me know if you have any questions and I apologize in advance if I've misunderstood what the last request field is supposed to denote.
Pete
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the code that handles API requests does not update the stored last-request timestamp for the token.
Impact
Administrators relying on the last request field could have a false sense of security because they cannot tell when a token was last used, which may delay detection of unauthorised token use.
What the attacker needed
A sandbox program; ability to create API tokens; API access
How it was found
- Create a new sandbox program
- Go to the program settings API page
- Create a token and assign the API user to standard user and admin
- Perform some API requests using curl
- Confirm notifications for the API actions appear
- Reload the API page and see the last request value has not changed
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
An API token lets a program talk to a site. The site shows a 'Last request' date so admins know when the token was last used, but here it always says 'Never' even after use, which could give admins a false sense of security.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.