Research · Advisory

The back end never
expected a visitor

Field notes on the authentication failures I keep finding in mobile-app backends — and the server-side patterns that close them for good.

By Martin Mwathi, Orvantis Security · Published 7 October 2026 · Original research · 7 min read


Most mobile apps put their effort into the part you can see. The screens are smooth, the buttons are satisfying, the sign-up flow is polished. None of that is where an attacker goes. I don’t climb a well-built fence — I walk around it. The front end is a suggestion; the API behind it is the law. And in engagement after engagement, that back end turns out to have been built as if no one would ever talk to it directly.

This piece distils the recurring failures I see when I test the server behind a mobile app, drawn from recent authorized assessments. No client is named, and nothing here is a working exploit — the point is the pattern and the fix, not a recipe. Every example below maps to a defect I have reproduced end-to-end against a live backend, then watched disappear once the server started enforcing its own rules.

The one habit that causes most of it

The client is a suggestion; the server is the law.

A mobile app can enforce a password policy, validate an email, and hide an endpoint — and every one of those checks evaporates the moment someone calls the API directly, which takes about thirty seconds. If a rule matters, it has to live on the side your user can’t edit. Nearly every finding below is a variation on a rule that existed only in the app.

Why client-side checks do not protect the API A normal user goes through the app, which runs its validation and sends a clean request. An attacker skips the app entirely and calls the API directly with input the app would have rejected. Both requests reach the same endpoint; only the server-side checks apply to both. Normal user via the app app validation policy, format, hidden UI Attacker skips the app direct API call — skips the app empty password · wrong field · 10 KB input The API (the law) Does the SERVER re-check? ✓ yes → both paths safe ✗ no → attacker is already in
The app’s validation only guards the path through the app. The attacker takes the other road — and both roads end at the same endpoint.

The failures, by pattern

1. The server accepts credentials that can’t be credentials

I regularly find registration and login endpoints that accept an empty string, a JSON null, or a missing password field entirely — and then happily authenticate that same empty value later. The app’s “minimum 8 characters” rule was never a control; it was decoration. This is a direct authentication bypass, not weak policy.

2. A session token is issued with no proof of identity

Registration often hands back a signed, fully valid session token immediately — no email verification, no confirmation step. Supply an address that can’t even receive mail (a reserved .invalid domain) and you still get a token that works on protected endpoints. The result is unbounded junk-identity creation and the poisoning of every later flow that trusts “a registered email.”

3. Success messages that lie

A recurring and dangerous one: a password-reset endpoint that expects the new value in a field named new_password, but silently no-ops if the caller uses the more natural name password — while still returning “Password updated successfully.” The existing credential gets invalidated, the new one never gets set, and the user is locked out behind a green checkmark. A success response that isn’t backed by a completed write is not a feature; it’s a liability with good manners.

4. Oversized input that crashes — and confesses

Hand the server a password one byte over the bcrypt 72-byte boundary, or an email past its column limit, and instead of a clean 400 you get a 500 with a message like “Failed to secure password” or “Database error.” An unauthenticated caller can trigger server exceptions at will, and the distinct error strings quietly disclose the hashing implementation and the storage layer.

5. The “email” field that isn’t validated as one

No server-side format check means strings with no @, multiple @, embedded spaces, or none at all are accepted as account keys. No case normalisation means [email protected] and [email protected] become two different accounts, and a user who capitalises differently than they registered simply can’t log in.

6. Helpful oracles

Registration that returns 409 “Email already exists” for a known address and 201 for a new one is a clean account-existence oracle — a free guest list handed to anyone planning a phishing or credential-stuffing run.

7. The small stuff that adds up

Missing response security headers, request bodies with trailing content after the JSON that still get processed, debug and tooling strings shipped in the production build. None is a breach alone; together they signal a server that isn’t being strict about anything.

Why these rate higher than a scanner says

An automated scan reports most of these, if it reports them at all, as low or informational: “verbose error message,” “missing header,” “weak input validation.” That rating is measuring the symptom, not the consequence. An empty-password login is not weak validation — it is a full authentication bypass reachable by anyone, with no account required. A reset endpoint that returns success without writing is a self-service account lockout. A token issued without verification is unlimited identity creation on your platform. The severity lives in what the flaw lets someone do, and that is exactly the judgement a scanner can’t make and a human adversary makes first. It is why I rate from impact, not from the category label.

Try this against your own backend

You don’t need a lab to feel the problem. On a system you own or are authorized to test, put the app down and talk to the API directly — one command-line tool is enough. A few honest questions:

Each “uh-oh” is a rule that lived only in the app. If you find one and want it reproduced, scoped, and written up properly — that’s the work.

What good looks like

It isn’t all bad news, and the parts that are done right deserve naming — because “I tried to break this and couldn’t” is a finding too. Across the same engagements, I routinely verify backends that get the hard parts right:

The lesson: robustness is a choice made endpoint by endpoint. The pieces someone tends to, hold up. The pieces nobody’s looking at, don’t.

Closing it — five patterns that fix most of it

The findings above share a handful of root causes. Fix the pattern, not the symptom. Example code is Go, but the principle is language-independent.

A. Bind the request body strictly, and validate before any business logic. Decode into a typed struct with unknown fields rejected, so a wrong field name fails loudly (a 400) instead of silently standing in for the right one. Reject trailing content after the first JSON value.

fix-a — strict-binding.go
dec := json.NewDecoder(r.Body)
dec.DisallowUnknownFields()        // wrong/unknown field names fail loudly
if err := dec.Decode(dst); err != nil { return errInvalidBody }
if dec.More() { return errInvalidBody }   // reject trailing content

B. Enforce the credential rules server-side — presence first.

fix-b — validate-password.go
func validatePassword(p *string) error {
    if p == nil || strings.TrimSpace(*p) == "" {
        return errors.New("password is required")
    }
    if len([]byte(*p)) < 8 {   // server-side minimum, not client-only
        return errors.New("password too short")
    }
    return nil
}

Never authenticate on an empty or missing password at login, either — reject it before the hash comparison ever runs.

C. Make “success” contingent on the write actually happening. Never mutate a stored credential unless a new hash was successfully computed from a supplied value, and never return a success message that isn’t backed by a completed write.

D. Never leak internal detail in errors. Cap input length before the hashing step, log the real error server-side, and return a generic body.

fix-d — no-leak.go
if len([]byte(req.Password)) > 72 { return bad(w) }   // before bcrypt
// on failure: log.Printf("hash: %v", err); return generic(w, 500)

E. Validate email, normalise case, and stop the oracles. Anchored format check, lowercase on both read and write paths, case-insensitive uniqueness — and a neutral registration response so “already exists” stops being a yes/no lookup. Add HSTS and the standard response headers at the edge.

How I work

I test at the API layer, the way a locksmith ignores the handle and goes for the pins. Every finding is reproduced — at least twice, and independently re-verified — before it’s written down; what can’t be demonstrated is recorded as a negative, not carried as a vulnerability to pad a count. All live testing happens only against systems I’m authorized to test, on accounts I create for the purpose, with no denial-of-service bursts and no destructive operations. Findings go to the owner first, on a coordinated timeline, before anything is ever said in public.

The goal of all of this isn’t to make you afraid of attackers. It’s to make your back end boring to me — because a hacker who gets bored and wanders off to someone else’s API is the best review you’ll never read.

Related reading: the access-control flaw that leaks the most once you’re authenticated, and the attack surface the mobile app itself hands over.

Next field note You gave every user a copy of the client · 6 min read

Want this run against your systems?

Same rigor, your target. Independent, evidence-based, and never softened.

Start a conversation View services