Fail-Open Refund Check

Fail-Open Refund Check

Make the risk check fail, and the refund pays out.

What Is Fail-Open Refund Check?

A refund endpoint runs its risk check inside a try/catch, and the catch approves the refund when the check throws. That makes it a fail-open error-handling flaw: the one control that stops fraud is skipped exactly when it cannot run. You'll send one malformed field to make the check throw, watch a declined refund pay out, and read the raw error the response leaks. Then you make the handler fail closed: refuse on a failed check, log the error for on-call, and return a generic error with no internal detail.

What You'll Learn in Fail-Open Refund Check

Fail-Open Refund Check — Training Steps

  1. Read the refunds docs

    Tollvane publishes its refunds API endpoint for integrators. Every refund is scored by a risk service before any money moves. Bob reads the docs to see what stands between a refund request and a payout.

  2. The one check in the way

    One paragraph tells Bob what he has to get past.

  3. A normal refund request

    First, a clean request so Bob sees the check working. He asks for a refund on an order the risk service will not like.

  4. The check does its job

    With a well-formed request, the risk service runs and declines it.

  5. Make the check fail

    Bob changes one thing: he sends amount as a string instead of a number. The risk service expects a number, so scoring the request throws before it can reach a decision.

  6. Approved for free

    The same refund the check declined a moment ago is now approved and paid, because the check never finished. The endpoint failed open: when it could not get a risk decision, it let the refund through.

  7. Knowledge check

  8. The finance alert

    You own Tollvane's refunds service. Finance flagged a run of refunds that paid out with no risk decision recorded against them. Security operations traced the cause and emailed you.

  9. How often has this happened

    Before touching the code, see the blast radius. The refund log records every time the risk check was skipped and the refund approved anyway.

  10. Open the refund handler

    Open the refund handler and look at how it treats a failed risk check.

Security Framework Coverage

OWASP Top 10

  • A10:2025 Mishandling of Exceptional Conditions

OWASP ASVS

  • V16.5.3 Error Handling
  • V16.5.1 Error Handling

CWE

  • CWE-636 Not Failing Securely ('Failing Open')
  • CWE-755 Improper Handling of Exceptional Conditions
  • CWE-209 Generation of Error Message Containing Sensitive Information

CIS Controls

  • CIS 16 Application Software Security

NIST CSF

  • PR.AT-02 Individuals in specialized roles are provided with awareness and training so that they possess the knowledge and skills to perform relevant tasks with cybersecurity risks in mind
  • PR.PS Platform Security

NICE Framework

  • DD-WRL-003 Secure Software Development