4.1.11. Threat model and security analysis#

This chapter states what KyCH must protect, against whom, where the trust boundaries lie, and how each threat is addressed – including the security defects found and fixed while the EU wallets, the German eID and eIDAS were added, and the risks that remain. It uses the STRIDE classification (spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege) per component and flow.

4.1.11.1. Assets#

A1 – The integrity of an identification. The most important asset: an

identification that names the wrong person, or a person who did not take part, is a breach of the institution’s due-diligence duties. Everything that decides whether a presentation is accepted belongs here: the helpers’ checks, the trust configuration, the session binding.

A2 – Personal data in transit and at rest: claims, evidence and raw

presentations, for minutes in KyCH and its helpers, for years at the clients.

A3 – Credentials of the institution: the access certificate’s key

(wallets trust it as the institution), the terminal key and authorisation certificate (the card trusts it), the Connector’s and Metadata-Signer keys, kych-eid’s result signing key, the bridge’s SAML keys.

A4 – Secrets between components: the OAuth 2.0 client secrets, the

access tokens, the helpers’ API secrets.

A5 – The trust configuration: the lists of trusted entities and their

signer certificates, the master and block lists, the foreign nodes’ metadata and signers, the accepted issuer DIDs.

A6 – Availability of identification, and with it of the institution’s

onboarding.

A7 – The evidence’s value for later checks: that it can be verified

again, and that it says truthfully what was checked.

4.1.11.2. Actors#

  • The customer, honest, who wants to identify with as little friction and disclosure as possible.

  • An impostor, who wants to be identified as someone else: with a stolen or borrowed phone, card and PIN, a forged or altered credential, a revoked credential, or a genuine credential relayed from its holder (a phishing page that forwards the QR code or the eID start link).

  • A network attacker between any two parties outside the host.

  • A malicious wallet, eID client or proxy service, sending malformed or hostile data to the helpers’ parsers.

  • A compromised or careless third party in the trust chain: a PID provider, a list publisher, a status-list host, a foreign eIDAS node, the BerCA.

  • A local attacker: another process or user on the host, or a client of KyCH (Beekeeper’s lookup worker) gone wrong.

  • A compromised upstream component: a defect or a supply-chain attack in one of the helpers or libraries (Dependencies).

  • A compromised client (exchange, Beekeeper) or operator insider.

4.1.11.3. Trust boundaries#

Trust boundaries draws them: (1) the public interface behind the reverse proxy, (2) the helpers’ management interfaces, (3) the local host and its socket groups, (4) the trust anchors. Two properties of the design matter throughout:

  • KyCH does no cryptography on credentials. Every signature, every decryption and every trust decision is a helper’s or kych-trust’s. KyCH trusts its helpers completely: a compromised helper can report any identification it likes. This concentrates A1 in the helpers, which is why they are interchangeable and why their results were compared (Where the test results are).

  • The upstream helpers authenticate nobody. Their isolation is by socket, group and proxy configuration alone.

4.1.11.4. STRIDE by component and flow#

4.1.11.4.1. The OAuth 2.0 front (browser, client, KyCH)#

Threat

Mitigation

S

A party other than the client starts sessions or redeems codes.

/setup and /token need the client secret (stored as a bcrypt hash); the code is single-use, its replay detected in the same statement that marks it used; /info needs the access token.

S

An attacker who learns a verification id follows /return or /finalize to the redirect carrying the code (I10).

The code is useless without the client secret; state must match. Residual: no PKCE (RFC 7636 [RFC7636], which the OAuth 2.0 security BCP [RFC9700] recommends for every client); a client with a weak state check could be fed a foreign code.

T

The redirect URI is changed to send the code elsewhere.

It must equal one registered for the client; it is re-checked against the registration at /finalize and /return (I48), and /token requires the same value (RFC 6749 4.1.3). Residual: /authorize stores the URI before it validates it (I48); only the re-check stops a stored bad URI.

T

Script injection into KyCH’s pages through state or a helper’s URL.

Values in the page’s script are JSON-encoded with <, >, & escaped (fixed in this project: a client’s state could close the page’s <script>); wallet links are scheme-checked against https and the vocabulary’s WALLET_SCHEMES; a Content Security Policy is sent with the pages.

R

A client disputes what it was given.

Every log line of a request carries a request id; the evidence carries KyCH’s verification id and the helper’s record.

I

Claims beyond the request reach the client.

KyCH cuts the claims down to the requested paths before storing them (fixed in b3a6199: a wallet presenting its issuer’s always-disclosed claims had them stored and served). Residual: the raw presentation in the evidence stays as signed (I66; Data retention and purge).

I

Claims are kept longer than needed.

Purge after PURGE_GRACE; sweeping of everything expired (Data retention and purge).

D

Session flooding.

Sessions need the client secret; they expire after 15 minutes; request bodies are capped. Rate limiting is the reverse proxy’s.

E

A client of KyCH reaches the helpers’ management APIs.

KyCH’s socket has its own group kych-api; the helpers’ sockets are www-data, which no client may be given (fixed, I56: KyCH’s socket used to share www-data).

4.1.11.4.2. Wallet and OpenID4VP helper#

Threat

Mitigation

S

A forged credential, or one from an issuer that is not a PID provider (an attestation provider claiming urn:eudi:pid:1).

The issuer’s signature and its chain to a provider listed for the class PID on a verified list snapshot (kych-trust); a credential of another class fails.

S

A genuine credential presented by someone else, or replayed.

Holder binding: the key-binding JWT or deviceSignature over the request’s nonce and audience (or the SessionTranscript); replay digests in kych-oid4vp; the response encrypted to the session’s key.

S

Cross-device relay: a phishing page shows the victim a QR code obtained from KyCH for the attacker’s session.

The wallet shows the verified relying party name from the access certificate and the registration certificate’s purpose. Residual: inherent to cross-device flows (analysed in [HAUCK2023], [OID4VP-FA]); same-device flows and the W3C Digital Credentials API reduce it.

T

Altered or smuggled disclosures, digest mismatches.

The disclosure digests are checked; a disclosure no digest covers fails (walt.id answered such forgeries with “try again later” until our patch 0007, I36).

T

A revoked PID made acceptable by a status list re-signed by a stranger.

Fixed in our EUDI verifier patch 0004 (I14: upstream checked no status-list signature at all); walt.id and kych-oid4vp check the list’s signer against the revocation services of the class. A report to the Commission’s vulnerability address is drafted.

T

Revocation information in a mechanism the helper cannot check (an ISO 18013-5 identifier list) taken for none.

kych-oid4vp and walt.id fail closed (status_unsupported; fixed for kych-oid4vp in ba8f472, I39). Residual: the EUDI verifier accepts such an mdoc (open; draft report).

T

An SD-JWT VC whose iss its certificate does not name.

kych-oid4vp and walt.id with kych-trust refuse it. Residual: the EUDI verifier and walt.id in TRUST = self accept it (I63).

R

A customer denies having identified.

The evidence holds the holder-bound presentation, checkable offline.

I

The response is read on the way.

direct_post.jwt: encrypted to the helper’s per-session key; the request object is handed out once, so the response URI is known to the first fetcher only.

D

Garbage posted to the response URI ends the person’s session.

Accepted by decision (I24/I32): every helper fails such a session at once rather than hanging; only a racer of the real wallet knows the URI. Residual: an oversized response refused by the proxy leaves the session open until it expires (I20).

D

A PID provider’s status list is down.

The check fails closed (status_unavailable): availability is traded for safety.

4.1.11.4.3. kych-trust and the trust lists#

Threat

Mitigation

S/T

A forged list, or a list from the wrong publisher.

Its signature must verify against the configured scheme operator’s certificate (LOTE_SIGNER); it must be of the configured type.

T

A rollback to a superseded, validly signed list (which still names a suspended provider).

The sequence number must exceed the one in use; expired lists (NextUpdate) are refused, and an expired snapshot trusts nothing. Residual: walt.id in TRUST = self has no rollback protection (I30); a restored stale database lowers the bar until the next fetch (Administration).

R

Which list a decision was taken on.

Every snapshot is kept verbatim; the evidence names it.

D

The publisher is unreachable or serves garbage.

The last good snapshot stays in force until its NextUpdate.

E

Trust decisions differ between helpers.

One trust helper for all three (by design, Trust). Residual (I12): no revocation check of the providers’ certificates themselves (delisting is relied on), no pointers to other lists, decisions at “now”.

4.1.11.4.4. The German eID (npa)#

Threat

Mitigation

S

A cloned or forged card.

Chip Authentication (the chip proves a key the document signer signed) and Passive Authentication against the master list and defect list; PACE and EAC are analysed in [BENDER2009], [DAGDELEN2010].

S

A revoked or expired card.

The block list via Restricted Identification, and the document validity checked by the card; a stale block list stops new sessions.

S

Relay: whoever has the start page’s URL can run their own eID client into the session (every eID server attached this way).

The PIN is the holder’s; the eID client shows the service provider from the authorisation certificate. Residual: a person tricked into identifying on a phishing page that relays the link.

T

A tampered or replayed answer.

Middleware route: SAML signature and encryption, checked by the bridge; a replayed answer changes nothing. kych-eid: the result never travels through the browser. Both tested (testing/npa/RESULTS-differential.md).

R

The identification cannot be proven to a third party.

Residual by design: the card authenticates to the eID server only; the evidence is the institution’s own server’s signed statement (What the evidence proves).

I

The eID server reads more than the purpose allows.

The authorisation certificate’s CHAT limits it on the card; kych-eid checks that the effective rights lie within those offered and include those required; the bridge refuses a request beyond BRIDGE_SAML_PERMITTED_ATTRIBUTES (I72).

D/E

Hostile data from an eID client or card: XML (PAOS) and BER-TLV parsers in kych-eid.

quick-xml without DTDs, size and depth limits; bounded TLV parsing. Residual: kych-eid needs an external security review before production (I76, below).

4.1.11.4.5. eIDAS#

Threat

Mitigation

S/T

XML signature wrapping, XML encryption attacks, hostile XML ([SOMOROVSKY2012], [JAGER2013], [SPATH2016]); the eIDAS network’s own history of such flaws ([ENGELBERTZ2018]).

All XML signature and encryption handling is the Commission’s eIDAS-Node Connector’s; KyCH and the bridge parse no SAML of the foreign node. Tested: tampered response, untrusted and expired metadata (testing/eidas/RESULTS.md).

S

A foreign node not trusted by the institution.

Its metadata signer must be in the Connector’s trust store.

T

Light token forged or replayed.

The bridge checks the token’s digest with the shared secret and accepts it once.

E/I

A local process reads or writes the Connector’s Hazelcast caches (persons’ attributes for minutes; forged light requests).

Residual (I85): Hazelcast as used has no authentication; the Connector and the bridge must run on a host without untrusted local users. Loopback only.

D

An error a node detects itself never reaches KyCH; the session hangs until it expires (I80).

The Connector’s error page names the institution (--contact-email). A patch is possible.

R

The assertion’s signature cannot be checked later.

The evidence holds the signed response (our Connector patch 0001, I81); where the state does not sign assertions, keep the Connector’s decryption key as long as the evidence.

4.1.11.4.6. Helpers’ management interfaces and the host#

Threat

Mitigation

S

Anyone who reaches a helper’s management API starts or reads verifications (the EUDI verifier, walt.id, swiyu-verifier, the middleware authenticate nobody).

Unix sockets or loopback only, socket groups, never proxied; tested from outside (43 of 43) and locally as the lookup worker (testing/system/socket-groups.sh). KyCH’s own helpers also require a bearer secret.

S

A forged notification to /notification.

It carries no data: KyCH asks the helper, authenticated, for the outcome (I35); recorded so that a later API never puts outcome data into it.

I

Secrets read by another local user.

Configuration and key files root:GROUP 0640 or the service user’s 0400; systemd hardening; secrets in included files.

E

A compromised helper reports arbitrary identifications.

Accepted as a consequence of the design. Interchangeable helpers let an operator switch away from a suspect one at once; the evidence lets results be re-checked where the vocabulary allows.

4.1.11.5. Security findings of this project#

The work that added the EU wallets, the German eID and eIDAS found and fixed these defects (numbers refer to the project’s issue log; testing/ records the test that shows each fix):

Issue

Finding and resolution

I14

The EUDI verifier believed any status list: the signature check was stubbed out, so whoever answers a PID’s status URI could un-revoke it. Fixed by our patch 0004 (chain, signature, and the signer’s trust in the revocation context); draft report to the Commission. walt.id, which checks the signer, needed its own patch 0004 to accept a separate status provider that the list authorises.

I16, I20, I24, I32

Responses refused before validation (undecryptable, cleartext to an encrypted request, oversized) were invisible: sessions hung until expiry. Decision: fail at once for every helper. EUDI verifier patch 0005, walt.id patch 0006, kych-oid4vp by design; the oversized response refused by the proxy stays open.

I36

walt.id answered forged disclosures with 503 “temporarily unavailable”, inviting a retry. Patch 0007.

I37

A walt.id session’s evidence was built in the trust mode of the current configuration after a switch, reporting a trusted issuer as untrusted. Fixed in f59af48.

I39

Revocation information in an unsupported mechanism was taken for none (fail open). Fixed for kych-oid4vp (ba8f472); open for the EUDI verifier; draft report.

I45, I48

A failed identification told the client nothing; stored redirect URIs were not re-checked. Fixed: access_denied redirects, re-checked against the registration.

I56

KyCH’s socket shared www-data with the helpers’ unauthenticated sockets, so a KyCH client could reach them. Fixed: group kych-api.

I66 / b3a6199

KyCH stored and served every claim a presentation revealed, not the requested ones. Fixed; the raw presentation stays as signed (accepted, documented).

I35

The notification is unauthenticated. Accepted: it carries no data.

I72

A request beyond the Berechtigung hung at the middleware. Mitigated by the bridge’s permitted-attribute check.

I85

Hazelcast without authentication. Accepted with the host requirement.

S2

A client’s state could close the wallet page’s <script>. Fixed by escaping.

4.1.11.7. Further reading#

The OAuth 2.0 front. KyCH’s client-facing side is a plain OAuth 2.0 authorization code flow. Its formal analyses in the Web Infrastructure Model – of OAuth 2.0 [FETT2016], OpenID Connect [FETT2017], the Financial-grade API [FETT2019] and FAPI 2.0 [HOSSEYNI2024] – found attacks that the security BCP [RFC9700] now addresses (PKCE among them); audience injection [HOSSEYNI2026] concerns signature-based client authentication, which KyCH does not use (its clients authenticate with a secret).

OpenID4VP and the EU wallet. The formal analyses of OpenID4VP ([HAUCK2023], [OID4VP-FA]) single out the cross-device flow, which KyCH’s QR code is. Credential pooling [RUFINI2026] and credential lending [MISHRA2026] describe impostors who present genuine credentials of others through a proxy; holder binding alone does not stop them, and they are a residual risk for any remote identification. Architectural critiques of the EU framework [TERMONT2026] and a user study showing that people overshare from their wallets [ZINGG2026] bear on how profiles should be kept small (Configuration).

Privacy of the credentials. Surveys of selective-disclosure mechanisms [FLAMINI2024] and anonymous credentials for wallets [BORMANN2026], zero-knowledge presentations of existing documents [ROSENBERG2023], device-bound anonymous credentials [FRIEDRICHS2025], pseudonyms [MAYRHOFER2025] and privacy-preserving revocation [FLAMINI2026] describe where the wallets may go. The debate between signed data and an authenticated channel [BERTRAM2026] is the one behind Features and limitations’s contrast between the PID’s checkable evidence and the German card’s deniable one.

The German eID card. Restricted Identification, the card’s pseudonym recorded as RestrictedID, is analysed in [BENDER2012], [KUTYLOWSKI2011] and [HANZLIK2015]; user mistakes in eID protocols in [EDSTROM2025]; and why so few citizens use the online function in [HARBACH2013] – one reason the documents fallback stays necessary.