Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Finding ID
Body
Finding status update data
Finding user status update request
The new user status for the finding
open
, active
, muted
"active"
Response
OK
Security finding information
Name of the security agent that found this issue
"race"
Assessment of how feasible an attack would be
easy
, medium
, hard
"easy"
Step-by-step attack walkthrough
"1. The attacker authenticates as a valid user and identifies two accounts they control.\n2. The attacker crafts multiple concurrent POST requests to the /api/v3/transfer endpoint."
Vulnerability class/category
"race"
Confidence level of the finding
high
, medium
, low
"high"
When the finding was created
"2025-05-29T22:27:39.047356Z"
Detailed description of the finding
"The MakeTransfer handler performs a read-modify-write sequence on account balances without any locking or database transaction, making it vulnerable to race conditions."
HTTP method of the vulnerable endpoint
"POST"
Path of the vulnerable endpoint
"/api/v3/transfer"
Code snippet showing the fix
"tx := db.Begin()\nres := tx.Clauses(clause.Locking{Strength: \"UPDATE\"}).Where(&models.Account{\n\tToken: input.AccountFrom,\n\tPartition: currentUser.Partition,\n}).First(&source)"
Handler class name where the vulnerability exists
"ApiController"
Handler method name where the vulnerability exists
"MakeTransfer"
Finding ID
"race-3f1174136e93fdf8d26511869343804fddcfeb0a948aa81aafa352f3612dd500"
Location of the vulnerability in the code
Finding name/title
"Race condition in account balance update allows overdrawing via concurrent transfers"
Project ID where the finding was discovered
"5d41402abc4b2a76b9719d911017c592"
Recommended remediation steps
"Wrap the balance check and update logic in a database transaction and use row-level locking (e.g., SELECT ... FOR UPDATE) to prevent concurrent modifications."
Estimated effort to fix the issue
easy
, medium
, hard
"easy"
Commit hash where the finding was discovered
"981be7365cc7b7da32d5ab28e635f6d35b0ff4f1"
Repository ID where the finding was discovered
"1e7d8c9b-ce80-41ae-8645-5b2a89165615-gitlab-69265683"
Repository URL
"https://gitlab.com/ghostsecurity/ghostbank-go"
Type of secret for secret findings
"api_key"
Severity level
high
, medium
, low
"high"
Current status of the finding
open
, open_muted
, closed
"open"
Additional files that support this finding
When the finding was last updated
"2025-05-29T22:27:39.047356Z"
Current user status of the finding
open
, active
, muted
"active"
Code snippet showing the vulnerability
"// find source account\nres := db.Where(&models.Account{\n\tToken: input.AccountFrom,\n\tPartition: currentUser.Partition,\n}).First(&source)"