Arviser

ZAP alert 10098, Cross-Domain Misconfiguration: is it real, how to fix it, what to tell the customer

Facts

Scanner finding
KB-F-0003 · Web and API
Also known as
Cross-Domain Misconfiguration
Tool IDs
ZAP 10098 "Cross-Domain Misconfiguration" (passive, Medium, CWE-264, WASC-14). Related: ZAP 40040 "CORS Header" (active)
Standard
Fetch Standard, CORS protocol
Lab
scanner-findings, last run 2026-11-26 (run 8): nginx 1.30.8, Express 5.3.0 with cors 2.8.6, ZAP 2.17.0, images pinned by digest
Test
tests/cors.sh url [trusted-origin], fails on the vulnerable target, passes after the fix
Next review
2027-05-28

Short answer

ZAP 10098 fires when a response carries Access-Control-Allow-Origin: *, nothing more. That lets any website read the response from a visitor's browser, but only without cookies, since the Fetch Standard does not allow * with credentials. It is real when the response depends on the caller's network position. For public content it is usually accepted risk; ZAP users often mark it as a false positive (ZAP's statistics, 2026-11-26). Fix: send the header only to origins on your allowlist, from one layer.

1. What the scanner saw

The rule is short. It reads Access-Control-Allow-Origin from each response and raises the alert when the value equals * exactly (rule source). It does not read Access-Control-Allow-Credentials, it does not look at the content, and it has no exceptions for public files. Risk Medium, confidence Medium.

So 10098 says "this response is readable from any origin, without credentials". It does not say the response is sensitive. ZAP's own alert text notes that browsers will not hand an authenticated response to a third-party site in this case, and that "This reduces the risk somewhat" (ZAP 10098).

The more dangerous CORS mistake is a server that copies the caller's Origin into the header and adds Access-Control-Allow-Credentials: true. A site on any domain can then read logged-in responses. 10098 does not detect that. ZAP's active rule 40040 does: it sends made-up Origin values and rates a reflected origin Medium, or High when credentials are allowed (ZAP 40040, rule source). Our Express target with cors({ origin: true, credentials: true }) echoed https://evil.example.test with Access-Control-Allow-Credentials: true, and our test failed it; ZAP baseline cannot see this.

2. Is it real on your system?

Look at the URLs in the alert, then send a request with a foreign origin:

curl -sI -H 'Origin: https://evil.example.test' https://api.example.com/v1/me | grep -i '^access-control-allow'

Then decide what the URL serves:

APIs that authenticate with a bearer token in a header set by your own JavaScript are not readable by another site through * alone, because that site does not have the token.

3. How serious it is for you

Our view: for a public, unauthenticated resource, informational. For an internal or IP-restricted service, Medium as ZAP rates it, since the network position is the credential and * gives it away. A reflected origin with credentials allowed is the serious case. Check for it even when the report shows only 10098.

A customer who sees Medium in a report will often ask for a fix anyway. If the URL serves public data, a short accepted-risk reply with the reason usually settles it. If you would rather not argue, restricting the header costs little.

4. Fix it on your platform

The fix in every case: decide which origins may read the response, send the header only to them, and add Vary: Origin so caches keep the answers apart.

nginx (lab-tested on 1.30.8)

map $http_origin $cors_origin {
    default                     "";
    "https://app.example.com"   $http_origin;
}

server {
    ...
    location /api/ {
        add_header Access-Control-Allow-Origin $cors_origin always;
        add_header Vary Origin always;
        ...
    }
}

Unknown origins map to an empty value, and in our lab nginx then sent no Access-Control-Allow-Origin at all. The map block goes at http level (nginx map). Remember that a location with its own add_header stops inheriting headers from server, so repeat HSTS and other headers there. In our lab the trusted origin got its own value back and https://evil.example.test got nothing.

Set CORS in one layer only. When nginx sits in front of an app that already sends CORS headers, the block above adds a second Access-Control-Allow-Origin: our proxy target in front of an Express cors() app sent both * and the trusted origin, and browsers reject a response with two. Remove the header from the app, or hide it in nginx:

location /api/ {
    proxy_pass http://app:3000;
    proxy_hide_header Access-Control-Allow-Origin;
    add_header Access-Control-Allow-Origin $cors_origin always;
    add_header Vary Origin always;
}

With proxy_hide_header our test passed. This block passes OPTIONS preflight requests to the app, so the app (or nginx) must still answer them. Check one preflight from your trusted origin with curl -X OPTIONS -H 'Origin: ...' -H 'Access-Control-Request-Method: POST'; we did not run a preflight in the lab.

Express and Node.js (lab-tested on Express 5.3.0, cors 2.8.6)

const cors = require('cors');
app.use('/api', cors({ origin: ['https://app.example.com'] }));

app.use(cors()) with no options is the same as origin: "*" (cors README). Our vulnerable Express target used exactly that and ZAP raised 10098 on /api/data. With the allowlist the alert was gone. Add credentials: true only if your front end really sends cookies to this API: it lets the listed origin read cookie-authenticated responses, which is more access than the * the scanner flagged. Avoid origin: true, which reflects every origin; with credentials: true it is the serious case above.

Apache httpd (from documentation, not run by us)

Find where Header set Access-Control-Allow-Origin "*" is set (mod_headers) and remove it from locations that do not serve public data. For an allowlist, the usual pattern combines SetEnvIf Origin with Header set ... env=; we did not test it, so test it with cors.sh before you rely on it.

IIS, Cloudflare, AWS, Vercel and Netlify (not run by us)

On these platforms the header usually comes from the application or from a response-header rule you added. Find which layer sets it with the curl check above, then change it there.

5. What to tell the customer

Example wording, adapt to what is true.

Fixed:

Thank you for the report. /api/ on api.example.com now returns Access-Control-Allow-Origin only to https://app.example.com. Requests from other origins get no CORS header. Attached are the response headers for a request from an unlisted origin and from our own origin, captured on .

Accepted, public resource:

The flagged URLs () serve public content that is the same for every visitor and needs no login. Access-Control-Allow-Origin: * is intended there. Browsers do not let another site read these responses when cookies are included, and we do not use this header on authenticated endpoints. We checked with an unlisted origin; none returned an Access-Control-Allow-Origin header (output attached, ).

Evidence to attach: curl -sI -H 'Origin: https://evil.example.test' output for each flagged URL and for one authenticated endpoint.

6. Test: fails before the fix, passes after

Our script cors.sh, run as sh cors.sh url [trusted-origin], sends Origin: https://evil.example.test and, if given, your trusted origin.

7. What we ran

Run 8, 2026-11-26: nginx 1.30.8, Express 5.3.0 with cors 2.8.6, ZAP 2.17.0, images pinned by digest. Every test ran from a GNU and a BusyBox client with the same exit codes, and once more with one required tool removed from PATH, which gave "not tested" (exit 2) every time.

Target Configuration Our test ZAP baseline
ngx-vuln add_header Access-Control-Allow-Origin "*" on /api/ fail: * 10098 on /api/data
ngx-fixed map allowlist, Vary: Origin pass: unlisted origin gets none, trusted origin echoed no 10098
app-vuln app.use('/api', cors()) fail: * 10098 on /api/data
app-fixed cors({ origin: [...] }) allowlist pass no 10098
app-reflect cors({ origin: true, credentials: true }) fail: echoes the unlisted origin, credentials true not scanned (10098 would not fire)
proxy 10443 nginx allowlist in front of an app sending * fail: *, and two headers for the trusted origin not scanned
proxy 11443 same with proxy_hide_header pass not scanned
nginx traps 27443, 28443, 29443 "* ", a tab before *, header name in capitals fail on each (read as *) not scanned
nginx trap 30443 https://app.example.com, * in one value fail (comma-separated value) not scanned
nginx trap 31443 $http_origin echoed, including null fail for both unlisted origins not scanned
a port that never answers not tested (exit 2) not run

The run was done by Claude Opus 5.5 (agent) on an internal Docker network with no outside access. Expected results were written before each run and are in the lab's results folder, with the raw outputs, image digests and file hashes of run 8. Runs 2 to 8 were checked in four rounds by a separate AI agent; the fourth round compared run 8 with its expected results.

Sources

Primary records first. Record identifiers link from the facts box.

Scanner rules and tool documentation

Standards and specifications

Vendor documentation and statements

Our lab

Corrections

  • 2026-11-28: The "What we ran" line listed Apache httpd, which this finding did not run, and left out cors 2.8.6 and ZAP 2.17.0.

Report an error to contact@arviser.com.

How this page was made: Claude Opus 5.5, an AI model, built and ran the lab and wrote this page from the sources listed. Separate AI agents checked the claims and the lab tests in four rounds. Vadim Nareyko approved the family template and the sample pages on 26 November 2026, from a summary in Russian.

Text and data on this page: CC BY 4.0. Code in our lab: MIT. Quoted third-party material keeps its own terms.

Send written scope or question (Free)