-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The patch is the CAUTION block\n\nThe merged PR touches two files. `README.md` at the repo root gets three lines added after the Docker invocation:\n\n```markdown\n> [!CAUTION]\n> The rest adapter does not support any authentication nor authorization. It must be used in a trusted environment, e.g. as a Kubernetes side-car or with a reverse proxy.\n```\n\n`epa4all-rest-service/README.md` gets the same three-line CAUTION block plus one in-place edit. The text above the production Docker example reads:\n\n```diff\n- This is the example for PRODUCTION. Handle with care ;)\n+ This is the example for PRODUCTION. This is assumed to run in a trusted environment.\n```\n\nThat is the diff. The GitHub advisory ([GHSA-c82x-f4xr-qv33](https://github.com/advisories/GHSA-c82x-f4xr-qv33)) names `com.oviva.telematik:epa4all-rest-service` ≤ 1.2.4 as vulnerable. The \"Patched Versions\" field is empty for the same reason the diff is Markdown. The code never moved. The advisory tags the bug CWE-306, Missing Authentication for Critical Function. The pull request describes the fix in its own title: documentation disclaimer.\n\n## What the rest adapter does\n\n`epa4all-rest-service` is a small Undertow server published by Oviva, a digital-health vendor operating in Germany. It fronts `epa4all-client`, the library that talks to a Konnektor over the Telematikinfrastruktur. The Konnektor is the on-prem appliance every German healthcare institution operates to mediate access to TI; its job is to physically hold the institution's SMC-B card and sign requests with it. SMC-B is *Sicherheitsmodul Karte Betriebsstätte*, the institutional smartcard gematik issues to recognised facilities. Possessing one is what makes a write to the electronic patient record (ePA) register as authored by a healthcare facility.\n\nThe REST adapter routes two endpoints. The router lives in `Main.java#buildHandler`:\n\n```java\nreturn new DisableCacheHandler(\n new BlockingHandler(\n withErrorHandling(\n Handlers.routing()\n .get(\"/health\", ex -> { ... })\n .post(\n \"/documents\",\n ex -> {\n ex.startBlocking();\n\n var req = om.readValue(ex.getInputStream(), DocumentCreateRequest.class);\n\n var res =\n clientService.writeDocument(\n req.insurantId(), req.contentType(), req.content());\n\n om.writeValue(\n ex.getOutputStream(),\n new WriteDocumentResponse(res.documentId().toString()));\n ex.setStatusCode(201);\n })\n .post(\n \"/documents/{document_id}\",\n ex -> { /* same shape, calls replaceDocument */ }))));\n```\n\n`withErrorHandling` is the only wrapper between the wire and the handler. It catches `BadRequestException`, `DuplicateDocumentClientException`, `NotAuthorizedClientException`, and `ApplicationException`, and maps them to HTTP status codes. It does not authenticate. It does not check a header. It does not call into a security context. There is no other middleware, no filter chain, no Undertow security handler installed in `buildServer`. The router goes straight from the listener to the JSON parser to `clientService.writeDocument`.\n\nThe body the parser expects is three fields:\n\n```java\npublic record DocumentCreateRequest(\n @JsonProperty(\"insurant_id\") String insurantId,\n @JsonProperty(\"content_type\") String contentType,\n @JsonProperty(\"content\") byte[] content) {}\n```\n\n`insurant_id` is the patient's KVNR, the German national health-insurance identifier. `content_type` is the MIME type, `application/fhir+xml` or `application/pdf`. `content` is the document bytes, base64. The handler hands them to `Epa4allClientService.writeDocument`:\n\n```java\nreturn withClient(\n client -> {\n var authorInstitution = client.authorInstitution();\n var documentId = UUID.randomUUID();\n var document =\n buildDocumentPayload(\n documentId, insurantId, authorInstitution, contentType, contents);\n client.writeDocument(insurantId, document);\n return new WriteDocumentResponse(documentId);\n });\n```\n\n`client.authorInstitution()` reads the identifier off the SMC-B card the Konnektor is holding. `buildDocumentPayload` assembles an IHE document whose `Author` block carries the SMC-B's TelematikId, the institution's name twice, the professionOID for digital health applications (`1.2.276.0.76.4.282`), and the document metadata required by the gematik EU-Pilot spec. `client.writeDocument` signs the bundle via the Konnektor and posts it to the ePA Document Service.\n\nThere is no caller identity in any of those bytes. The institution is the SMC-B. The author is the SMC-B. The signature is the SMC-B. The KVNR is whatever the request body said. The patient's record receives a document. The document says the institution wrote it. The institution did not. Whoever could reach `POST /documents` did.\n\nThe endpoint that replaces an existing document, `POST /documents/{document_id}`, is gated by `UUID.fromString` parsing the path parameter. Any well-formed UUID reaches `replaceDocument` with the same KVNR-from-body semantics.\n\n## The request that does it\n\nThe README's own example, copied verbatim from `epa4all-rest-service/README.md`:\n\n```shell\ncurl -X 'POST' \\\n 'http://localhost:8080/documents' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"insurant_id\": \"X110661675\",\n \"content_type\": \"application/fhir+xml\",\n \"content\": \"PEJ1bmRsZSB4bWxucz0iaHR0cDovL2...ZXNvdXJjZT4KICAgPC9lbnRyeT4KPC9CdW5kbGU+Cg==\"\n}'\n```\n\nThe KVNR `X110661675` is the example identifier. The base64 is a FHIR bundle. The server returns `201 Created` and a UUID:\n\n```json\n{\"id\":\"ed498df6-fd0d-45b9-9964-157efb0f4f47\"}\n```\n\nThe request worked because the request reached the handler. The handler did not check who sent it because the handler was not written to check. `Handlers.routing()` knows about paths. `BlockingHandler` knows about the worker pool. `DisableCacheHandler` knows about `Cache-Control`. None of them know about a caller.\n\nSubstitute `localhost` for the host where someone ran the production Docker command. Substitute any well-formed eleven-character KVNR for `X110661675`. The handler returns 201. The Konnektor signs. The ePA stores a document authored by the institution against a patient who is not their patient.\n\n## The trust the service projects was never the service's to hold\n\nHealthcare-facility authority in the German TI is a physical-token model. gematik issues an SMC-B card under recognition of a healthcare institution. The card is inserted into a Konnektor inside the institution's perimeter. The Konnektor terminates TLS to TI, signs writes with the card, and the ePA write API treats the card's signature as proof the caller is the institution. The point of the architecture is to make institutional authority unforgeable by binding it to an object the operator can lock in a server cabinet.\n\nThe rest adapter consumes one Konnektor and exposes its capability over HTTP. The Java client library it wraps connects to the Konnektor with mTLS, ECC client certs from a PKCS#12 keystore, the works; `EPA4ALL_CREDENTIALS_PATH` and `EPA4ALL_CREDENTIALS_PASSWORD` are the configuration knobs for the rest service's leg of that connection. None of that protects the rest adapter's own HTTP listener. The credentials authorise the adapter to talk to the Konnektor. They do not authorise anyone in particular to talk to the adapter.\n\nA hospital IT department wires this service up because calling SOAP themselves against a Konnektor with the TI proxy and ECC-Auth is tedious. The adapter is the convenience layer over the smartcard. Convenience, by construction here, is \"ask, get a write.\" The Java that builds the document does not know whether the caller is an EHR system on the institution's LAN or a curl from the parking-lot Wi-Fi. The SMC-B does not know either. The Konnektor signs and the record is written.\n\nThe CAUTION block PR #43 added asks the operator to make the reachability of port 8080 match the authority the SMC-B is supposed to be. It is asking the operator to construct, around the rest adapter, the institutional perimeter the SMC-B card was supposed to be the proof of.\n\n## The defaults the CAUTION block does not change\n\n`Main.java#loadConfig` declares `EPA4ALL_ADDRESS` defaulting to `0.0.0.0`:\n\n```java\nvar address = configProvider.get(\"address\").orElse(\"0.0.0.0\");\nvar port = configProvider.get(\"port\").map(Integer::parseInt).orElse(8080);\n```\n\nThe Dockerfile declares `EXPOSE 8080`. Neither line changed in PR #43. The production Docker example in `epa4all-rest-service/README.md` reads:\n\n```shell\ndocker run --rm \\\n -e 'EPA4ALL_KONNEKTOR_URI=https://10.156.120.103:443' \\\n -e 'EPA4ALL_PROXY_ADDRESS=' \\\n -e 'EPA4ALL_CREDENTIALS_PATH=/credentials.p12' \\\n -e 'EPA4ALL_CREDENTIALS_PASSWORD=' \\\n -e 'EPA4ALL_ENVIRONMENT=PU' \\\n -v './credentials.p12:/credentials.p12' \\\n -p '8080:8080' \\\n ghcr.io/oviva-ag/epa4all-rest-service:latest\n```\n\n`-p '8080:8080'` binds the container's port to every interface on the host. The non-production \"RU with localhost\" example, two sections down, reads `-p '127.0.0.1:8080:8080'`. The example marked PRODUCTION is the one with the wider binding. The example marked development is the one with the loopback bind. PR #43's only edit to that section is the line that turned `Handle with care ;)` into `This is assumed to run in a trusted environment.`\n\nThe CVSS vector reads `CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`. `AV:A` is adjacent network; the assessment assumes the deployment that the CAUTION block prescribes. Operators who copy-pasted the production Docker command got the deployment the CAUTION block does not describe. The CAUTION block does not narrow `EPA4ALL_ADDRESS`, does not narrow the `-p` map, does not switch the listener to a UNIX socket, does not change the Dockerfile. It writes a sentence describing the network the bug requires to exist.\n\n## Internal-only by convention, with the convention now in ink\n\n[`internal-only-by-convention`](/patterns/internal-only-by-convention) is the pattern's name in our catalogue: a contract the framework defines as internal-IPC-only, read on every inbound network request with security-relevant authority. The contract is documentation, not enforcement. Prior exhibits all keep the convention and bolt enforcement onto a single endpoint: Chamilo's `install.ajax.php` got an `APP_INSTALLED=1` env-var check, Flowise's `WHITELIST_URLS` had three entries removed, [Next.js's `x-middleware-subrequest`](/posts/next-middleware-cve-2025-29927-recursion-guard-was-the-bypass) got a per-process secret, nginx-ui's `/api/install` got a 32-byte hex file at mode `0600`. The convention stays implicit. The patch adds something the runtime can read.\n\nCVE-2026-47672 is the same pattern with a different patch. The convention is not bolted to anything, not replaced, not narrowed. It is rewritten as a CAUTION block. The product's authorisation is held by the same thing it was held by before the CVE: the operator's perimeter. The CVE record is the acknowledgement that the perimeter is not the product's to hold. The pull request is the acknowledgement that the vendor agrees.\n\nThis is also [`unpatchable-primitive`](/patterns/unpatchable-primitive) in its calmest form. The handler reads JSON and forwards it to the SMC-B; that is what the service is for. Adding a token check to the handler would require defining what a healthcare-professional token means, and gematik already answered that question with the card. The vendor cannot answer it again at the rest adapter without either re-deriving the card's authority from an HTTP credential of its own choosing (the CWE-306 finding restated as a CWE-287 design decision) or admitting that the rest adapter is the part of the system whose job is to forget the answer. The CAUTION block is the admission.\n\nPoC: [oviva-ag/epa4all-client](https://github.com/oviva-ag/epa4all-client)","closing_line":"The handler still signs with the institution's smartcard for whoever reaches the port. The README now says so.","hook_md":"Pull request #43 in `oviva-ag/epa4all-client` carries the title `EPA-275: Documentation Disclaimer reg. API authorization`. It is six lines added and one line replaced across two README files. No Java file is touched. No `pom.xml` is bumped. No new artifact is published to Maven Central.\n\nIt is the patch for CVE-2026-47672, a Missing Authentication for Critical Function finding on a Java REST adapter that wraps the on-prem device that physically holds a German healthcare institution's SMC-B smartcard.","post_id":557,"slug":"epa4all-cve-2026-47672-patch-was-the-caution-block","title":"CVE-2026-47672: epa4all-rest-service Wraps the SMC-B Smartcard. The Patch Is a README CAUTION Block.","type":"initial","unreadable_sentence":"It is asking the operator to construct, around the rest adapter, the institutional perimeter the SMC-B card was supposed to be the proof of."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCaqhH/QAKCRDeZjl4jgkQ JieCAP9vsToAX22CzdDjwbSqjfc6KY7Jgq2j1I/RmWjVwxAazwD/SjZlPCnn/h9i CDIaJF9yVlzsS9bFlVBm8FySvW4L3gQ= =80U/ -----END PGP SIGNATURE-----