Securing an Application Built with AI: Lessons from a Real-World Test
Two separate accounts on an AI-built web application were issued the same Authorization Bearer token and API key. An attacker holding that shared credential could impersonate other users and access their data.
Published on medium.com
Artificial Intelligence (AI) applications are becoming more common across industries, from fintech to healthcare. While AI adds new capabilities, it also introduces unique risks—especially when developers fail to implement strong authentication and access controls.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application generated static or shared credentials instead of creating a unique token and API key for each user session.
Impact
A user with the shared token or API key could impersonate other accounts and access sensitive data, and if tokens were shared across roles a regular user could perform admin-level actions.
What the attacker needed
Ability to create two accounts; access to issued tokens and API keys
The fix
The application should issue unique Bearer tokens per session tied to individual users with expiration and refresh, generate user-specific API keys, apply role-based access controls, add rate limiting, and audit authentication regularly.
How it was found
- Create two separate accounts on the platform.
- Compare the Bearer token issued to each account.
- Compare the API key issued to each account.
- Observe that both accounts received identical credentials.
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 write-up has not been written yet. The Original tab links to the source.
When you log in to a website, the site gives your browser a secret pass (a token) so it knows who you are on later requests. Here, every account got the same pass, so the site could not tell users apart. Anyone who saw that pass could act as any other user.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.