This is a deliberately vulnerable web application that simulates a custodial cryptocurrency exchange with an IDOR (Insecure Direct Object Reference) vulnerability. It's designed for educational purposes to demonstrate how IDOR vulnerabilities can be exploited.
This application has a critical IDOR vulnerability in the fund transfer functionality. The vulnerability allows an attacker to:
- Log in as a legitimate user
- Initiate a fund transfer request
- Intercept and modify the request to change the
sender_idparameter to a different user's ID - Successfully transfer funds from the victim's account to any account without proper authorization
- Node.js (v14+)
- npm
- Clone this repository
- Navigate to the project directory
- Install dependencies:
npm install - Start the application:
or for development with auto-reload:
npm startnpm run dev - Access the application at
http://localhost:3000
You are a regular user of the crypto exchange. You've found out about a potential vulnerability in the fund transfer functionality and want to test if you can exploit it to transfer funds from another user's account to your own.
-
Setup Burp Suite:
- Configure your browser to use Burp Suite as a proxy
- Ensure Intercept is turned on
-
Login to Your Account:
- Login with one of the following accounts:
- Username:
alice, Password:password123 - Username:
bob, Password:password123 - Username:
charlie, Password:password123
- Username:
- Login with one of the following accounts:
-
Identify the Victim:
- On the dashboard, you'll see your user ID displayed
- Your goal is to transfer funds from the user with ID 4 (username:
victim)
-
Initiate a Normal Transfer:
- Go to the "Send Funds" section
- Select any user as the recipient
- Enter a small amount to transfer (e.g., $10)
- Click "Send Funds"
-
Intercept the Request with Burp Suite:
- When you click "Send Funds," Burp Suite will intercept the POST request
- Examine the request parameters
- You'll see a parameter called
sender_idwith your user ID
-
Modify the Request:
- Change the
sender_idvalue from your ID to the victim's ID (4) - Ensure the
recipient_idis set to your own user ID - Forward the modified request
- Change the
-
Verify the Exploit:
- If successful, you'll be redirected to the dashboard
- Check your balance - it should have increased
- The victim's funds have been transferred to your account without their authorization
-
Insecure Direct Object Reference (IDOR):
- The application trusts user-supplied IDs without verifying ownership
- No server-side validation to ensure the logged-in user owns the sending account
-
Improper Access Control:
- The application fails to enforce proper access controls on sensitive operations
- No authentication check for financial transactions
-
Trust in Client-Side Parameters:
- The application blindly trusts parameters sent from the client
- No validation against session data to ensure legitimacy
The proper fix would be to:
- Never trust user-supplied IDs for sensitive operations
- Always derive the sender ID from the authenticated session
- Implement proper server-side ownership validation
- Use cryptographic signatures or tokens to validate transaction requests
- Implement proper logging and monitoring for suspicious activities
This application is intentionally vulnerable and is designed for educational purposes only. Do not deploy this application in a production environment or use the demonstrated techniques against real-world systems without proper authorization.
MIT