A Web Application Security Assessment of Vuln-Bank (Part 2)
The report describes multiple application-level flaws in a deliberately vulnerable banking app: SQL injection allowed login bypass, a weak JWT secret permitted forging admin tokens, a password reset flow leaked a short PIN and accepted invalid PINs, reflected XSS was possible via the username field, and the loan system lacked validation for zero, negative, or oversized amounts. An attacker could take over accounts, escalate privileges, and manipulate financial logic.
medium.com
Published on medium.com
In the first part of this series, I walked through the setup, reconnaissance, and initial exploitation of Vuln-Bank, where I gained remote code execution and uncovered weak admin credentials. Building on that, Part 2 shifts focus to application-level flaws.
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 missing input validation and insecure design choices: unsanitised SQL queries, a guessable JWT secret, a short PIN without rate limiting, an API version that leaks secrets, unsanitised output, and no server-side validation of loan amounts.
Impact
An attacker could bypass authentication, forge admin tokens to access the admin panel, reset other users' passwords, execute script in a victim's browser (though the alert did not fire in the image test), and manipulate loan amounts to bypass financial rules, leading to account takeover, privilege escalation, data exposure, and financial manipulation.
What the attacker needed
Access to the vulnerable app; a valid account or login page; ability to intercept HTTP traffic; a wordlist for JWT secret cracking
How it was found
- Test SQL injection on the login page with a tautology payload in username and password.
- Intercept a JWT from the response and brute-force its HS256 secret with a wordlist.
- Modify the JWT payload to set is_admin to true and change username to the admin, then use the forged token.
- Request a password reset and change the API endpoint from v2 to v1 to disclose the reset PIN.
- Use the disclosed PIN to reset the password, or fuzz the reset endpoint with invalid PINs to bypass verification.
- Inject a script tag and an image tag with an onload handler into the username field to test reflected XSS.
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.
This write-up covers several common web security mistakes in a practice app. SQL injection lets an attacker trick a login form into letting them in without a password. A weak JWT secret means the token that proves who you are can be forged, like a fake ID. A password reset PIN with only 1000 combinations and no rate limit can be guessed, and an old API version leaked the PIN. Reflected XSS means user input is shown on the page without cleaning, so a script could run in a victim's browser. The loan form accepted zero, negative, or huge numbers because it did not check them.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.