---
url: /operations/link-domain-allowlist.md
---

# Link domain allowlist

Markdown links in chat and canvas are sanitized against a domain allowlist (code default: `[]` — no link is treated as allowlisted):

```yaml
allowed_link_domains: ["*.muenchen.de"] # code default: []; an empty list leaves no link unsanitized
```

Entries are glob-style host patterns: `*` matches any sequence of characters and every other character is literal. Matching is a full match of the URL hostname only — no scheme, port, userinfo or path in the URL enters the match. `*.muenchen.de` covers all subdomains of the deployment's site but not the apex host `muenchen.de` itself; if an apex entry is ever needed for other deployments, list it as its own entry (`["*.example.org", "example.org"]`). An entry without `*` is an exact hostname (`company.de`). A `*` must be followed by at least two dots so the pattern ends in a fixed domain: a suffix wildcard like `*company.de` reaches unintended hosts (`evil-company.de`), `srv*.de` matches arbitrary `srv-anything.de` hosts, and a trailing `*` matches everything — all of these fail validation at startup, as do non-ASCII entries (use punycode `xn--` A-labels for IDN) and scheme, port, userinfo, path or whitespace in an entry. Allowlisted hosts are treated as https endpoints, so a clickable link that names one of them as a bare `http://` host is upgraded to `https://`. The list is exposed to the frontend via `/config`. Links are displayed as `description (url)` with the URL part clickable — allowlisted hosts keep their full URL; every other link stays clickable but loses its query string, fragment and userinfo (the channels that could transmit conversation data to a server). Images from allowlisted hosts load automatically; any other image shows a placeholder with the sanitized URL and is fetched only after the user approves it. Approvals are stored per conversation in the `chats` table (`approved_images`/`rejected_images` columns).

The approval lists are enforced where images render: the browser decides which images display in chat and inlines approved images as data URIs into the export request. The server-side image fetch during PDF/DOCX export checks only `allowed_link_domains` — never the per-conversation approvals — so the core service never fetches a user-approved arbitrary host (that would make the export endpoint an SSRF proxy). During export the core service downloads images hosted on the allowlisted domains server-side (the browser cannot read their bytes because they do not send CORS headers): HTTPS only, redirects re-validated against the allowlist, a 5 MiB per-image response cap, a 10 s timeout and `image/*` content types required — the core service therefore needs outbound HTTPS access to these hosts. Export links carry only `http`/`https`/`mailto` schemes; anything else is dropped server-side before the converters run.
