AC-031 Conformance caught CS-PROBE-004

A request without credentials is accepted

The server accepts too much

How to run this card's commands yourself

1. The problem

In one sentence

The spec says an operation needs credentials (a bearer token), and the server answers it without any.

A story

The spec marks GET /lenient/no-auth as secured with a bearer token and declares a 401 answer. During a refactor the authentication step is removed from the route. Nobody notices, because every client the team owns sends a token anyway. An outside caller with no token reads {"secret":"s3cret"}.

Why it hurts

Security that is declared but not enforced is worse than none, because everyone believes it is there. Your own clients keep sending credentials, so normal tests and normal use never show the hole.

  • For developers: authentication is often added by a middleware. When a route is moved or a middleware is skipped, the route is open and nothing else changes.
  • For managers: this is a security exposure: private data readable by anyone who finds the URL. It is a different class of risk from a wrong status code, and should be treated as one.
  • For DevOps: test that secured routes refuse a request with no credentials, as an automatic check after every deploy.

Example

The spec fragment:

security:
  - bearerAuth: []
responses:
  "200":
    $ref: "#/components/responses/Secret"
  "401":
    $ref: "#/components/responses/Unauthorized"

The two servers in the sandbox, asked without a token:

lenient/no-auth  GET  ->  200 OK              {"secret":"s3cret"}
strict/no-auth   GET  ->  401 Unauthorized    {"code":"unauthorized","message":"a valid bearer token is required"}

How to detect it without clrsig

  • curl -i URL without an Authorization header. A secured route must answer 401 (no credentials) or 403.
  • List every route and its authentication rule, and check each one is covered by the same middleware.

How to fix it

There are two usual causes:

  1. The code is wrong (almost always). Put the route behind the authentication rule, ideally by default for the whole API, with an explicit exception for public routes.
  2. The spec is wrong. The route is meant to be public. Remove its security entry.

To tell which: ask whether the data is meant for the public. If in doubt, close it. Treat a confirmed hole as a security incident: check access logs for who used it.

AC-032 Wrong, expired or under-privileged credentials are accepted, AC-030 A missing required parameter is accepted, AC-035 Authentication error codes are mixed up. Failure-catalog demo: FM-025-02 (authentication error code confusion).

Words used on this page are explained once in the glossary.

2. How clrsig helps

Check

CS-PROBE-004 Missing credentials accepted. State: caught. Severity today: failure (exit code 1). With --negative, clrsig sends a request to a secured operation with the credential removed, wherever the spec puts it (the Authorization header, an API-key header, a query parameter or a cookie), and expects 401 or 403. It does not probe an operation where authentication is optional.

Command

This operation is a GET, so nothing is written:

clrsig conform specs/conform-fail.yaml \
  -b http://localhost:8080/conform-fail \
  --env clrsig/environments/conform-fail.yaml \
  --negative --paths /lenient/no-auth --explain

Exit code: 0 clean, 1 a finding, 2 the spec or the setup is broken. Here it is 1.

What you see

Output from clrsig v0.21.0, recorded on 2026-11-30. The lines for the 75 operations that --paths skipped are left out by grep -v '^ SKIP'; no line is edited.

conform-fail API  1.0.0
Base URL: http://localhost:8080/conform-fail
Limited by --paths /lenient/no-auth

  PASS  GET     /lenient/no-auth  200  16ms

PASSED  76 operations  ·  1 passed  ·  0 failed  ·  75 skipped  18ms

Negative conformance probes — conform-fail API 1.0.0
  FAIL  GET /lenient/no-auth — no credentials (expect 401/403)
         server accepted invalid request with 200

FAILED  1 probe  ·  0 passed  ·  1 failed  ·  0 skipped  ·  0 errors  2ms
       1 probe sent no credentials and the server still accepted the request — fix the authentication rule for those operations

How to read it: the first request carries a token (from the environment) and passes. The probe sends the same request with no credentials, and the server answers 200, so the probe fails. For the strict control (--paths /strict/no-auth) the probe passes with 401.

Where to look

  • Desktop app: the Check Conformance page has a “Get CLI command” button that shows the command for a run, so you can add --negative to it.
  • Reports: --format json lists the probes under probes; --format junit has one test case per probe.
  • GitHub Action: the negative input turns it on.

How clrsig helps you fix it

It proves that a secured route answered without credentials, which is the evidence you need to act. The closing line says that the probe sent no credentials and the server still accepted the request, and to fix the authentication rule for those operations.

Limits

  • Only the absence of credentials is probed. Wrong, expired and under-privileged credentials are not (AC-032).
  • The probe expects 401 or 403. Another 4xx passes with a warning (CS-PROBE-007), and a 429 leaves the probe not checked (CS-PROBE-008); --fail-on warning fails the run on both. A pass is still no proof that the request was refused for this fault, so read the status printed beside it.

More ways

Nothing yet.

3. Video brief for Google NotebookLM

VIDEO BRIEF — AC-031 · A request without credentials is accepted
Length: 5 to 7 minutes. Language: English. Audience: developers, with a line each for managers and DevOps.
One idea: security that is declared but not enforced is worse than none, because everyone believes it is there.
Open with this story: The spec marks an operation as secured with a bearer token and declares a 401 answer. During a refactor the authentication step is removed from the route. Nobody notices, because every client the team owns sends a token anyway. An outside caller with no token reads the secret.
Say these facts, in this order:
1. The spec requires a bearer token. The lenient server answers 200 with a secret and no token. The strict server answers 401.
2. Your own clients keep sending credentials, so normal tests and normal use never show the hole.
3. clrsig conform with negative removes the credential, wherever the spec puts it, and expects 401 or 403.
4. The probe fails because the server answered 200.
5. Two usual causes: the code is wrong (put the route behind the authentication rule, by default for the whole API), or the spec is wrong because the route is meant to be public.
6. For managers: this is a security exposure; if confirmed, check access logs for who used it.
7. For DevOps: test that secured routes refuse a request with no credentials after every deploy.
Show on screen: the security part of the spec, the two server answers, the command (clrsig conform specs/conform-fail.yaml -b http://localhost:8080/conform-fail --env clrsig/environments/conform-fail.yaml --negative --paths /lenient/no-auth --explain), and the output block, copied exactly from the card.
Name the check: CS-PROBE-004, Missing credentials accepted. Say the clrsig version: v0.21.0.
Explain these words once: bearer token (a secret string sent in the Authorization header to prove who you are); 401 (not authenticated); 403 (authenticated but not allowed); negative probe (a request that is wrong on purpose, which the server must refuse); exit code (0 clean, 1 a finding, 2 setup or spec broken).
Say what clrsig does not see here: only the absence of credentials is probed, not wrong, expired or under-privileged ones; a probe refused with another 4xx passes with a warning, a 429 is reported as not checked, and even an expected status is no proof the request was refused for that fault.
Safety line (if a write is shown): not needed, this operation is a GET.
Finish with three recap questions:
1. What should a secured route answer to a request with no credentials? (401 or 403.)
2. Why do normal tests miss this? (The team's own clients always send credentials.)
3. What do you do after confirming a hole? (Treat it as a security incident and check the access logs.)
Tease the next video: AC-032 · Wrong, expired or under-privileged credentials are accepted.
Do not: say "contract testing" alone; say clrsig "catches everything"; invent flags, IDs or numbers; read tables aloud; use any fact that is not in the card.