2026-11-19 · 4 min read

The Pope's prayer app left 700,000 accounts open through one missing check. Here is that check in a pull request.

In July, a researcher who writes as BobDaHacker published how Click to Pray, the Pope's official prayer app, handed out its users' data. An API endpoint, /user/users/{id}, took a sequential numeric id and "returns user data for any account when you supply a valid user ID": email, name, country, date of birth. In the researcher's words, "No authorization check. No ownership validation." With 719,517 registered accounts and no rate limit, every one of them could be read by counting upwards. The researcher reported it on January 3, 2026 and heard nothing back for about seven months; after Dark Reading covered it, the endpoint was changed to return only a first and last name for other people's ids.

That bug has a name: an insecure direct object reference, or IDOR. OWASP calls the API version broken object level authorization and puts it first in its API Security Top 10: an attacker gets at other users' data "by manipulating the ID of an object that is sent within the request".

Illustration: three requests to an API with consecutive user ids: the first returns your account, the next two return other people's email, name and birth date.

Signing in doesn't fix it

Click to Pray's endpoint knew who was calling. It just never checked whether the id was theirs, and sign-up was open, so in practice anyone could do it. The same bug shows up in software with paying customers. In June, an advisory for FOSSBilling, an open-source billing system, described one: "An authenticated client can access any other client's custom service by guessing sequential order IDs." The lookup "fetches any order by ID without filtering by client_id", which exposed other clients' names, emails, phone numbers, addresses and VAT numbers. According to the advisory, four sibling modules, including domains and hosting, checked ownership; this one didn't.

That's why IDOR is a review problem more than a testing problem. The endpoint works. The author's tests pass, because they use the author's own records. The bug is a line that isn't there.

Find the missing line

Here's a pull request in the same shape: an agent adds a PDF download for invoices to an app where every route already requires a signed-in user.

ai-agent wants to merge · app/routers/invoices.py +9
41+ @router.get("/invoices/{invoice_id}/pdf")
42+ def invoice_pdf(invoice_id: int,
43+ user: User = Depends(get_current_user),
44+ db: Session = Depends(get_db)):
45+ """Download an invoice as PDF. Signed-in users only."""
46+ invoice = db.get(Invoice, invoice_id)
47+ if invoice is None:
48+ raise HTTPException(404, "Invoice not found")
49+ return pdf_response(invoice)

It's short, it handles the not-found case, and the docstring says "Signed-in users only", which is true: get_current_user rejects anonymous requests.

What a trained eye flags here

Line 46 looks up the invoice by the id in the URL and never compares its owner with user. Any signed-in customer can download anyone's invoice by changing the number, and invoices carry names, addresses and amounts. The comment that earns full marks: "line 46 needs to scope the lookup to the caller, e.g. filter by Invoice.id == invoice_id and Invoice.customer_id == user.customer_id, and answer 404, not 403, for someone else's invoice so the response doesn't confirm that the invoice exists."

The habit behind it: for every id that comes from the request, ask who is allowed to see the thing it points at, and find the line that enforces it. Authentication answers "who are you"; it doesn't answer "is this yours".

Practise on the same shape

Two PRs in the DiffDojo library hide this bug class, both in FastAPI: Add an invoice void endpoint and Add a CSV export for invoices. Review them before you read the answers; the second one is the multi-tenant version, where the record belongs to an organisation rather than a person.

Try a review

Find the missing ownership check before you read the answer.

Leave inline comments and a verdict, then see what you caught. A free account unlocks 1 PR of your choice. The pass opens the full library.

Review the invoice void PR →
Read next Python API authorization bug: a code review exercise
← All posts