From 7a9753f4bc569f1b15ddfbe51d6eef557c7d4d65 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:19:45 +0000 Subject: [PATCH 01/15] Start squad log for issue 587 --- specs/issue-587/log.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 specs/issue-587/log.md diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md new file mode 100644 index 00000000..769cbdb6 --- /dev/null +++ b/specs/issue-587/log.md @@ -0,0 +1,8 @@ +# Log: Issue #587 + +One line per pipeline step: date and time of day (UTC), step, member, result. Lead decisions and escalations +are quoted in full. + +| Date | Step | Member | Result | +| ---- | ---- | ------ | ------ | +| 2026-11-28 16:19 | 1 Intake | Orchestrator | Bug, open, no comments; branch claude/admiring-sagan-njkqq9 off main 70f80f7 | From 028c3817b60ba6babf443b13f50bddcc43575eea Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:23:30 +0000 Subject: [PATCH 02/15] Plan issue 587 --- ...nd-an-entry-that-is-not-one-is-left-out.md | 55 +++++++ docs/decisions/README.md | 1 + specs/issue-587/log.md | 1 + specs/issue-587/plan.md | 155 ++++++++++++++++++ 4 files changed, 212 insertions(+) create mode 100644 docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md create mode 100644 specs/issue-587/plan.md diff --git a/docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md b/docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md new file mode 100644 index 00000000..ff92a366 --- /dev/null +++ b/docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md @@ -0,0 +1,55 @@ +# 0076: The .NET release index is parsed as a remote JSON object, and an entry that is not one is left out + +- **Status:** Proposed +- **Date:** 2026-11-28 +- **Area:** Base images +- **Source:** Issue #587 +- **Supersedes:** 0019 — amends its consequence that the release feeds keep reporting a body with a string that does not decode as `unexpected error`: the .NET release index now reads `invalid response` for it. + +## Context + +The .NET release feed's `releases-index.json` is a JSON object whose `releases-index` array holds one object per +channel. `DotNetReleaseMetadataService` parsed it with `ExternalJson` and read its properties without checking the kind +of the root or of an entry, so a root that is not an object, an entry that is not one, or a string that does not decode +made the reader throw `InvalidOperationException`, and the fixed reason +([0009](0009-integration-results-carry-fixed-failure-reasons.md)) was `unexpected error`. The Docker Hub, OCI and Docker +Engine clients answer `invalid response` for such a body +([0073](0073-a-registry-answer-that-is-not-a-json-object-is-an-invalid-response-and-an-entry-that-is-not-one-is-left-out.md), +[0074](0074-a-docker-engine-stats-or-image-inspect-answer-that-is-not-a-json-object-is-an-invalid-response.md), +[0019](0019-remote-json-with-undecodable-strings-is-an-invalid-response.md)) and leave a non-object entry out +([0069](0069-a-docker-engine-list-item-that-is-not-a-json-object-is-left-out.md)). 0019 left the release feeds out +because their text reaches no message. The feed's message reaches no page or scan run either: a failure only suppresses +the runtime finding and is logged as warning 2101. The planning of #585 found the difference. + +## Options considered + +1. **Parse the index with `RemoteJsonDocument.ParseObjectAsync` and leave out an entry that is not an object (chosen)** + — the rule of 0073-0075 through the one helper that holds it; a malformed root and an undecodable string read + `invalid response` as in every other `JsonDocument` client. +2. **Check the root and answer the existing message for a missing `releases-index` array** — true for such a root, + but that message describes a well-formed index without the field, differs from the other clients' reason, and + leaves undecodable strings at `unexpected error`. +3. **A root check of its own that throws `JsonException`, without decoding the strings** — keeps tolerating an + undecodable string in a field the service never reads, but not in one it reads, and copies a check + `RemoteJsonDocument` holds once ([0075](0075-a-docker-engine-container-list-or-image-history-that-is-not-a-json-array-is-an-invalid-response.md), option 4). +4. **Keep `unexpected error`** — two reasons for one malformed body, and a reason that reads like an error of the + application (0074, option 2). +5. **Map `InvalidOperationException` to `invalid response`** — rejected by 0019 and + [0029](0029-registry-calls-answer-every-error-but-the-callers-cancellation-as-failed.md) for the misuse the runtime + reports with the same type. +6. **Refuse the whole index for an entry that is not an object** — the other entries still carry data (0069, 0073). + +## Decision + +Option 1: the .NET release index is parsed as a remote JSON object and refused as an invalid response otherwise or +when one of its strings does not decode; an entry of `releases-index` that is not a JSON object is left out. The rules +are in [Base images](../areas/base-images.md#release-feeds-and-runtime-findings) and +[Integration failures](../areas/integration-failures.md#fixed-failure-reasons). + +## Consequences + +- The feed's failed result reads `invalid response` instead of `unexpected error` for such a body, and warning 2101 + logs the refusal's fixed message; the runtime finding is suppressed as before. +- One undecodable string anywhere in the index, also in a field the service never reads, now fails the whole index, + where before only one in a field it reads did; Microsoft's feed is conforming JSON, so this is accepted. +- A malformed entry no longer hides the other channels of the index. diff --git a/docs/decisions/README.md b/docs/decisions/README.md index f696fdea..4fdc3e08 100644 --- a/docs/decisions/README.md +++ b/docs/decisions/README.md @@ -136,4 +136,5 @@ once in the [area document](../areas/README.md) of the record's area, and the re | [0073](0073-a-registry-answer-that-is-not-a-json-object-is-an-invalid-response-and-an-entry-that-is-not-one-is-left-out.md) | A registry answer that is not a JSON object is an invalid response, and an entry that is not one is left out | Accepted | 2026-11-28 | | [0074](0074-a-docker-engine-stats-or-image-inspect-answer-that-is-not-a-json-object-is-an-invalid-response.md) | A Docker Engine stats or image inspect answer that is not a JSON object is an invalid response | Accepted | 2026-11-28 | | [0075](0075-a-docker-engine-container-list-or-image-history-that-is-not-a-json-array-is-an-invalid-response.md) | A Docker Engine container list or image history that is not a JSON array is an invalid response | Accepted | 2026-11-28 | +| [0076](0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md) | The .NET release index is parsed as a remote JSON object, and an entry that is not one is left out | Proposed | 2026-11-28 | \ No newline at end of file diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index 769cbdb6..be2e5cc7 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -6,3 +6,4 @@ are quoted in full. | Date | Step | Member | Result | | ---- | ---- | ------ | ------ | | 2026-11-28 16:19 | 1 Intake | Orchestrator | Bug, open, no comments; branch claude/admiring-sagan-njkqq9 off main 70f80f7 | +| 2026-11-28 16:23 | 2 Plan | Lead | RESULT: DONE, tier standard, plan.md and decision record 0076 (opus/medium · 121,247 tokens · 28 tool uses · 218 s · 44 in · 19,965 out · 1,763,848 cache read · 119,722 cache write · 675,428 weighted) | diff --git a/specs/issue-587/plan.md b/specs/issue-587/plan.md new file mode 100644 index 00000000..5b5441ce --- /dev/null +++ b/specs/issue-587/plan.md @@ -0,0 +1,155 @@ +# Plan: A .NET release index whose root is not a JSON object reads `invalid response` + +Source: Issue #587 +Tier: standard — the .NET release feed answers a different fixed reason for malformed bodies and skips malformed index entries (a behavior change of input handling, no security control created, changed or removed). +Security areas touched: Failure messages and remote text (the fixed reason the .NET release feed's result carries and the exception its load-failure warning 2101 logs; no file listed for the area changes) + +## Problem / root cause + +`DotNetReleaseMetadataService.LoadIndexAsync` (`src/DockerUpdateGuard/Images/DotNetReleaseMetadataService.cs`) parses +the index with `ExternalJson.ParseAsync` (line 155) and calls `RootElement.TryGetProperty` (line 158) without checking +the root's kind. `JsonElement.TryGetProperty` throws `InvalidOperationException` on any element that is not an object, +so a root that is an array, string, number, `true`, `false` or `null` reaches the catch at lines 193-197, and +`FailureReason.FromException` maps it to `unexpected error` (only `JsonException` maps to `invalid response`). The +Docker Hub, OCI and Docker Engine clients answer `invalid response` for the same body because they parse with +`RemoteJsonDocument.ParseObjectAsync` (records 0073, 0074). + +Two related defects on the same path, found while planning: + +- **An entry of `releases-index` that is not a JSON object** (line 164-167: `TryGetString(releaseElement, …)` calls + `TryGetProperty` on it) throws the same `InvalidOperationException`, so one such entry fails the whole index with + `unexpected error`. Every other client leaves such an entry out (records 0069, 0073). +- **A JSON string that does not decode** (a lone surrogate escape `\ud800`) in a field the service reads throws + `InvalidOperationException` from `GetString()` (record 0019) and also reads `unexpected error`; record 0019 left the + release feeds out on purpose ("their text reaches no message"). + +## Verified facts + +| # | Claim | Evidence | Status | +| - | ----- | -------- | ------ | +| 1 | The index is parsed with `ExternalJson.ParseAsync` and `TryGetProperty` is called on the root without a kind check | `DotNetReleaseMetadataService.cs` lines 155-159 | confirmed | +| 2 | `JsonElement.TryGetProperty` and `GetString()` throw `InvalidOperationException` on a non-object element and on an undecodable string | .NET API documentation of `JsonElement.TryGetProperty` (throws when `ValueKind` is not `Object`); records 0019 (measured for `GetString()`), 0074 and 0075 (same throw on Engine roots) | confirmed | +| 3 | The catch maps every exception through `FailureReason.FromException`; only `JsonException` gives `invalid response`, an `InvalidOperationException` gives `unexpected error` | `DotNetReleaseMetadataService.cs` lines 193-197; `Infrastructure/FailureReason.cs` lines 78-83 | confirmed | +| 4 | The Docker Hub, OCI and Docker Engine clients answer `invalid response` for a non-object root | `RemoteJsonDocument.ParseObjectAsync` throws `JsonException("The remote response is not a JSON object")` (`RemoteJsonDocument.cs` lines 61-97), used in `DockerHubClient.cs`, `OciRegistryClient.cs`, `DockerInstanceClient.cs` (lines 499, 869) | confirmed | +| 5 | `RemoteJsonDocument.ParseObjectAsync` keeps the fixed parse-failure message of `ExternalJson` for malformed JSON | it calls `ParseAsync`, which calls `ExternalJson.ParseAsync` (`RemoteJsonDocument.cs` lines 37-53, 87) | confirmed | +| 6 | A non-object entry of `releases-index` throws as well | lines 164-167: `TryGetString` → `TryGetProperty` on the entry | confirmed | +| 7 | The failure message reaches no page or scan run: both orchestrators only test the status and return | `ImageScanOrchestrator.cs` lines 387-393 (the runtime orchestrator likewise); the exception is logged by warning 2101 (`ImageHostLoggingExtensions.cs` line 781) | confirmed | +| 8 | The nginx feed parses no JSON (it reads the `download/` page as text), so "the release feeds" in record 0019 and the area document mean the .NET feed only | `NginxReleaseMetadataService.cs` line 130 (`ReadAsStringAsync`), no JSON call in the file | confirmed | +| 9 | Record 0019 is released, so it is amended by a new record, not edited | its commit is in `v1.3.10` (`git tag --contains`) | confirmed | + +## Acceptance criteria + +- AC1: An index whose root is a JSON array, string, number, `true`, `false` or `null` makes `GetChannelReleaseAsync` + answer *failed* with the message `Loading .NET release metadata failed: invalid response` (decided by + `FailureReason.FromException` on the `JsonException` of `RemoteJsonDocument.ParseObjectAsync`), and warning 2101 logs + a `JsonException` with the message `The remote response is not a JSON object` and no inner exception. +- AC2: An index with a JSON string that does not decode (the escape `\ud800` written in the JSON text) — in a field the + service reads (`channel-version`) and in one it does not read — answers *failed* with + `Loading .NET release metadata failed: invalid response`. The test asserts that its input still contains the + backslash of the escape (`.squad/team.md`, *Escapes in files*). +- AC3: An entry of `releases-index` that is not a JSON object (a number, a string, an array, `null`, `true`) is left + out, and a valid entry beside it is still returned: the lookup of its channel *succeeded* with its latest runtime. + +## Tests per criterion + +| AC | Test(s) | Test file | +| -- | ------- | --------- | +| AC1 | `DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexRootIsNotAnObjectReportsInvalidResponseAsync` (one `DataRow` per kind: `[]`, `"text"`, `42`, `true`, `false`, `null`); `DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexRootIsNotAnObjectLogsFixedRefusalAsync` | `src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs` | +| AC2 | `DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexStringDoesNotDecodeReportsInvalidResponseAsync` (`DataRow` for the read and the unread field) | `src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs` | +| AC3 | `DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexEntryIsNotAnObjectLeavesItOutAsync` (one `DataRow` per kind, the entry placed before a valid `9.0` entry) | `src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs` | + +## Approach + +In `LoadIndexAsync`: + +1. Replace `ExternalJson.ParseAsync(responseStream, cancellationToken)` (line 155) by + `RemoteJsonDocument.ParseObjectAsync(responseStream, cancellationToken)`. A non-object root and an undecodable + string then raise `JsonException`, which the existing catch maps to `invalid response`; malformed JSON keeps its + fixed message. The check for the `releases-index` array (lines 158-162) and its message stay as they are. +2. In the loop, leave out an entry whose `ValueKind` is not `JsonValueKind.Object` (`continue`), before any property + is read — as one more condition of the existing skip at line 169, or a guard of its own above it. + +No new message, no new log event, no new type or member. + +Early draft PR: no — every criterion is a unit test + +## Options considered + +1. **Parse with `RemoteJsonDocument.ParseObjectAsync` and leave out non-object entries (chosen)** — the rule of + records 0073-0075 for the same kind of answer, through the one helper that already holds it; malformed roots and + undecodable strings read `invalid response` as in every other `JsonDocument` client. +2. **Check the root kind after `ExternalJson.ParseAsync` and answer the existing message `The .NET release index does + not contain a valid releases-index array`** — literally true for a non-object root, but that message describes a + well-formed index without the field, it differs from the reason the other clients give for the same body, and it + leaves undecodable strings at `unexpected error`. +3. **A root check of its own that throws `JsonException`, without the string decoding** — keeps today's tolerance of an + undecodable string in a field the service never reads, but leaves `unexpected error` for one it reads and copies + the check `RemoteJsonDocument` holds once (record 0075, option 4). +4. **Keep `unexpected error`** — two reasons for one malformed body, depending on which integration received it; the + reason reads like an error of the application (record 0074, option 2). +5. **Map `InvalidOperationException` to `invalid response` in `FailureReason`** — rejected by records 0019 and 0029: + the runtime raises it for unrelated misuse too. +6. **Refuse the whole index for a non-object entry** — the other entries still carry data; every other client leaves + such an entry out (records 0069, 0073). + +## Affected projects and types + +| Project | Type / file | Change | +| ------- | ----------- | ------ | +| `DockerUpdateGuard` | `Images/DotNetReleaseMetadataService.cs` | parse call and entry guard in `LoadIndexAsync` | +| `DockerUpdateGuard.Tests` | `DotNetReleaseMetadataServiceTests.cs` | the tests of *Tests per criterion* | + +## Signatures (for the Dev's skeleton) + +None: no API member is added or changed, so step 4 is skipped. `DotNetReleaseMetadataService.cs` is the only +production file the fix rewrites. + +## Test files + +`src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs` (new tests in the existing class). + +Existing test code that calls a changed signature: none. The existing tests of the class stay unchanged: none has an +input the criteria handle differently (malformed JSON, `{}` and `{"releases-index": []}` are object roots or parse +failures and keep their messages; their entries are objects). + +Files of the change no unit test can cover: none. + +## Areas + +- `docs/areas/integration-failures.md` (+20 words): *Fixed failure reasons* — the .NET release index joins the list of + answers whose root is not a JSON object; "the release feeds report it as `unexpected error`" becomes that the .NET + release feed refuses the whole index as well; *Related decisions* gains 0076. +- `docs/areas/base-images.md` (+45 words): *Release feeds and runtime findings*, the .NET bullet — an entry of + `releases-index` that is not a JSON object is left out; *Limits and errors* — "unreadable content" names malformed + JSON, a string that does not decode and a root that is not a JSON object; *Related decisions* gains 0076. +- `docs/areas/telemetry.md` (+5 words): *Credentials and external data* — the refusal with `The remote response is not + a JSON object` also covers the .NET release index. + +## Documentation updates + +The three area documents above, by the Dev, against the code as built. `docs/ARCHITECTURE.md`, `README.md` and +`.squad/project.md` need no change: the `ExternalJson`/`RemoteJsonDocument` sentences stay true, no setting changes. +No changelog file exists; the release-notes label is the orchestrator's (step 10). + +## Architecture check + +The guarantee of fixed failure reasons (record 0009, ARCHITECTURE.md *Integration failures*) is kept: the message +still carries only a fixed reason, now the more precise one. External JSON still passes `ExternalJson`, beneath +`RemoteJsonDocument`. No guarantee of `.squad/project.md` is weakened. + +## Security considerations + +- [x] No limits: the index is read whole as before. +- [x] Exceptions that reach a failure reason: `JsonException` (malformed JSON, undecodable string, non-object root) → + `invalid response`; every other exception as before. Warning 2101 logs the refusal's fixed message + (`The remote response is not a JSON object`, or the undecodable-string message with its decoding error), never + remote text. + +## Decision records + +- `docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md` + (Proposed) — amends 0019's consequence that the release feeds keep `unexpected error`. + +## Out of scope / follow-ups + +- The nginx feed (HTML text, no JSON) is unaffected. From 6ac5f83892f9572b9e6aaf6a48df54d2ac36e6e7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:24:28 +0000 Subject: [PATCH 03/15] Log plan challenge for issue 587 --- specs/issue-587/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index be2e5cc7..5edc2654 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -7,3 +7,4 @@ are quoted in full. | ---- | ---- | ------ | ------ | | 2026-11-28 16:19 | 1 Intake | Orchestrator | Bug, open, no comments; branch claude/admiring-sagan-njkqq9 off main 70f80f7 | | 2026-11-28 16:23 | 2 Plan | Lead | RESULT: DONE, tier standard, plan.md and decision record 0076 (opus/medium · 121,247 tokens · 28 tool uses · 218 s · 44 in · 19,965 out · 1,763,848 cache read · 119,722 cache write · 675,428 weighted) | +| 2026-11-28 16:24 | 2 Plan challenge | Devil's Advocate | VERDICT: NO OBJECTIONS (opus/medium · 41,705 tokens · 8 tool uses · 44 s · 16 in · 3,291 out · 232,833 cache read · 40,339 cache write · 157,073 weighted) | From eeab7ea676d91f45a6d839861ae4f7dcbb3ca98f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:24:45 +0000 Subject: [PATCH 04/15] Log plan security review for issue 587 --- specs/issue-587/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index 5edc2654..a2f63d1f 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -8,3 +8,4 @@ are quoted in full. | 2026-11-28 16:19 | 1 Intake | Orchestrator | Bug, open, no comments; branch claude/admiring-sagan-njkqq9 off main 70f80f7 | | 2026-11-28 16:23 | 2 Plan | Lead | RESULT: DONE, tier standard, plan.md and decision record 0076 (opus/medium · 121,247 tokens · 28 tool uses · 218 s · 44 in · 19,965 out · 1,763,848 cache read · 119,722 cache write · 675,428 weighted) | | 2026-11-28 16:24 | 2 Plan challenge | Devil's Advocate | VERDICT: NO OBJECTIONS (opus/medium · 41,705 tokens · 8 tool uses · 44 s · 16 in · 3,291 out · 232,833 cache read · 40,339 cache write · 157,073 weighted) | +| 2026-11-28 16:24 | 3 Plan security | Security | VERDICT: APPROVED; one non-blocking finding: add area 'Logging and telemetry of external data' to Security areas touched (opus/medium · 44,841 tokens · 8 tool uses · 67 s · 16 in · 4,773 out · 240,606 cache read · 43,161 cache write · 179,725 weighted) | From 5435cb8023232d5db74f15c832070c2fd57898db Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:24:54 +0000 Subject: [PATCH 05/15] Add security notes to plan of issue 587 --- specs/issue-587/plan.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/specs/issue-587/plan.md b/specs/issue-587/plan.md index 5b5441ce..a6758912 100644 --- a/specs/issue-587/plan.md +++ b/specs/issue-587/plan.md @@ -2,7 +2,7 @@ Source: Issue #587 Tier: standard — the .NET release feed answers a different fixed reason for malformed bodies and skips malformed index entries (a behavior change of input handling, no security control created, changed or removed). -Security areas touched: Failure messages and remote text (the fixed reason the .NET release feed's result carries and the exception its load-failure warning 2101 logs; no file listed for the area changes) +Security areas touched: Failure messages and remote text (the fixed reason the .NET release feed's result carries and the exception its load-failure warning 2101 logs; no file listed for the area changes); Logging and telemetry of external data (the exception warning 2101 logs for the .NET release index; no log call changes) ## Problem / root cause @@ -153,3 +153,29 @@ still carries only a fixed reason, now the more precise one. External JSON still ## Out of scope / follow-ups - The nginx feed (HTML text, no JSON) is unaffected. + +## Security notes + +Security plan review: specs/issue-587 (`/home/user/DockerUpdateGuard/specs/issue-587/plan.md`, `/home/user/DockerUpdateGuard/docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md`) + +The plan is approved. I found no blocking issues and one non-blocking one. + +**Tier is right at `standard`.** The change swaps `ExternalJson.ParseAsync` for `RemoteJsonDocument.ParseObjectAsync` and skips entries of `releases-index` that are not JSON objects. That is a parser's validation that only keeps malformed input from breaking the program, which the `security` row of *Tiers* (`.squad/routing.md` line 100) classes as input handling. It is not a guard that limits what an attacker can reach. It adds no new path, URL, credential or listener. The `releases.json` URL taken from each entry is read the same way as before. + +**What I checked by reading the code** +- `RemoteJsonDocument.ParseRootAsync` (`src/DockerUpdateGuard/Infrastructure/RemoteJsonDocument.cs` lines 85-97) throws `JsonException("The remote response is not a JSON object")` with no inner exception, and disposes the document first. `RemoteJsonDocumentTests.cs` lines 174-175 already test this. +- For malformed JSON, the fixed `ExternalJson` message is kept (lines 37-53). +- `EnsureStringsDecode` recursion is limited by the default `JsonDocument` maximum depth of 64, because the parse fails before the walk on anything deeper. It allocates nothing that is kept, since each decoded string is thrown away. "No limits" is therefore accurate: the index is held whole as before. +- Every exception still goes through the existing catch at `DotNetReleaseMetadataService.cs` lines 193-197. The result carries only the fixed reason. Warning 2101 (`ImageHostLoggingExtensions.cs`) has no message parameters, only the exception. +- The entry guard (`ValueKind != Object` → `continue`, placed before any property is read) closes every remaining path to `InvalidOperationException` from `TryGetProperty`. That leaves the root, the entries, and `GetString` on strings that are already decoded. + +**Measurement.** The security consideration says the logged decoding error carries no remote text. That rests on library behavior, and the change now also logs it for strings in fields the service never reads. So I measured it on .NET SDK 11.0.100 with a file-based program in `/tmp/claude-0/-home-user-DockerUpdateGuard/706e9084-0cbd-583b-a79c-d9b87f2dff75/scratchpad/m/m.cs`, run as `dotnet run m.cs`. It calls `JsonDocument.Parse`, then `GetString()` on `"SECRETTEXT\ud800SECRET"` and `"abc\udc00def"`. Output: +``` +InvalidOperationException: Cannot read incomplete UTF-16 JSON text as string with missing low surrogate. | inner: : +InvalidOperationException: Cannot read invalid UTF-16 JSON text as string. Invalid surrogate value: '0xDC00'. | inner: : +``` +Neither message contains the surrounding remote text: at most the surrogate's code-unit value, and no inner exception. So the claim holds, and so does the matching sentence in `docs/areas/telemetry.md` line 125. + +**Findings** + +1. [NON-BLOCKING] *Security areas touched* is missing an area. The plan lists only "Failure messages and remote text". But it changes which exception warning 2101 logs: the new "not a JSON object" refusal, plus the decoding error now raised for fields the service doesn't read. It also edits `docs/areas/telemetry.md` *Credentials and external data*, the area document of "Logging and telemetry of external data" (`.squad/project.md`, *Security areas*). Smallest fix: add that area to the line, for example `Security areas touched: Failure messages and remote text (…); Logging and telemetry of external data (the exception warning 2101 logs for the .NET release index; no log call changes)`. Recommendation: fix now From 865b01f8536f40d71699ce073a59b3d3b33e5a24 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:25:19 +0000 Subject: [PATCH 06/15] Revise plan of issue 587 --- specs/issue-587/log.md | 1 + specs/issue-587/plan.md | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index a2f63d1f..8b3cfefb 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -9,3 +9,4 @@ are quoted in full. | 2026-11-28 16:23 | 2 Plan | Lead | RESULT: DONE, tier standard, plan.md and decision record 0076 (opus/medium · 121,247 tokens · 28 tool uses · 218 s · 44 in · 19,965 out · 1,763,848 cache read · 119,722 cache write · 675,428 weighted) | | 2026-11-28 16:24 | 2 Plan challenge | Devil's Advocate | VERDICT: NO OBJECTIONS (opus/medium · 41,705 tokens · 8 tool uses · 44 s · 16 in · 3,291 out · 232,833 cache read · 40,339 cache write · 157,073 weighted) | | 2026-11-28 16:24 | 3 Plan security | Security | VERDICT: APPROVED; one non-blocking finding: add area 'Logging and telemetry of external data' to Security areas touched (opus/medium · 44,841 tokens · 8 tool uses · 67 s · 16 in · 4,773 out · 240,606 cache read · 43,161 cache write · 179,725 weighted) | +| 2026-11-28 16:25 | 2 Plan revise (security notes) | Lead | RESULT: DONE, area added, Security review section (opus/medium · 4,041 tokens · 4 tool uses · 19 s · 10 in · 1,107 out · 488,220 cache read · 5,178 cache write · 72,857 weighted · continued) | diff --git a/specs/issue-587/plan.md b/specs/issue-587/plan.md index a6758912..52159bfb 100644 --- a/specs/issue-587/plan.md +++ b/specs/issue-587/plan.md @@ -179,3 +179,12 @@ Neither message contains the surrounding remote text: at most the surrogate's co **Findings** 1. [NON-BLOCKING] *Security areas touched* is missing an area. The plan lists only "Failure messages and remote text". But it changes which exception warning 2101 logs: the new "not a JSON object" refusal, plus the decoding error now raised for fields the service doesn't read. It also edits `docs/areas/telemetry.md` *Credentials and external data*, the area document of "Logging and telemetry of external data" (`.squad/project.md`, *Security areas*). Smallest fix: add that area to the line, for example `Security areas touched: Failure messages and remote text (…); Logging and telemetry of external data (the exception warning 2101 logs for the .NET release index; no log call changes)`. Recommendation: fix now + +## Security review + +- Finding 1 (non-blocking, *Security areas touched* lacks "Logging and telemetry of external data"): accepted. The + area now stands on the *Security areas touched* line with the wording Security proposed. The orchestrator wrote it + and I confirm it unchanged: the change alters which exception warning 2101 logs and edits + `docs/areas/telemetry.md`, the area document of that security area. No log call, message parameter or other part of + the plan changes. Security measured the claim that the decoding error carries no remote text, so it stays in + *Security considerations* as fact. From 443d9742666bae91cd35443f2449419b0e7259e8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:25:35 +0000 Subject: [PATCH 07/15] Log security delta for issue 587 --- specs/issue-587/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index 8b3cfefb..95ade50b 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -10,3 +10,4 @@ are quoted in full. | 2026-11-28 16:24 | 2 Plan challenge | Devil's Advocate | VERDICT: NO OBJECTIONS (opus/medium · 41,705 tokens · 8 tool uses · 44 s · 16 in · 3,291 out · 232,833 cache read · 40,339 cache write · 157,073 weighted) | | 2026-11-28 16:24 | 3 Plan security | Security | VERDICT: APPROVED; one non-blocking finding: add area 'Logging and telemetry of external data' to Security areas touched (opus/medium · 44,841 tokens · 8 tool uses · 67 s · 16 in · 4,773 out · 240,606 cache read · 43,161 cache write · 179,725 weighted) | | 2026-11-28 16:25 | 2 Plan revise (security notes) | Lead | RESULT: DONE, area added, Security review section (opus/medium · 4,041 tokens · 4 tool uses · 19 s · 10 in · 1,107 out · 488,220 cache read · 5,178 cache write · 72,857 weighted · continued) | +| 2026-11-28 16:25 | 3 Plan security delta | Security | VERDICT: APPROVED (opus/medium · 3,119 tokens · 2 tool uses · 10 s · 6 in · 610 out · 88,222 cache read · 4,305 cache write · 25,697 weighted · continued) | From 3ec81ccb5e6ed9d57dc42ba5c5381bf2909ebe9f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:28:26 +0000 Subject: [PATCH 08/15] Add failing tests for issue 587 --- specs/issue-587/log.md | 1 + .../DotNetReleaseMetadataServiceTests.cs | 116 ++++++++++++++++++ 2 files changed, 117 insertions(+) diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index 95ade50b..fa7e13eb 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -11,3 +11,4 @@ are quoted in full. | 2026-11-28 16:24 | 3 Plan security | Security | VERDICT: APPROVED; one non-blocking finding: add area 'Logging and telemetry of external data' to Security areas touched (opus/medium · 44,841 tokens · 8 tool uses · 67 s · 16 in · 4,773 out · 240,606 cache read · 43,161 cache write · 179,725 weighted) | | 2026-11-28 16:25 | 2 Plan revise (security notes) | Lead | RESULT: DONE, area added, Security review section (opus/medium · 4,041 tokens · 4 tool uses · 19 s · 10 in · 1,107 out · 488,220 cache read · 5,178 cache write · 72,857 weighted · continued) | | 2026-11-28 16:25 | 3 Plan security delta | Security | VERDICT: APPROVED (opus/medium · 3,119 tokens · 2 tool uses · 10 s · 6 in · 610 out · 88,222 cache read · 4,305 cache write · 25,697 weighted · continued) | +| 2026-11-28 16:28 | 5 Tests first | Tester | RESULT: PASS, 14 new cases fail on current code (verified by Orchestrator), 10 existing pass. Deferred: none (sonnet/medium · 105,634 tokens · 10 tool uses · 141 s · 18 in · 5,486 out · 772,825 cache read · 104,652 cache write · 235,546 weighted) | diff --git a/src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs b/src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs index 05b47bee..10120bbe 100644 --- a/src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs +++ b/src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs @@ -1,4 +1,5 @@ using System.Net; +using System.Text.Json; using DockerUpdateGuard.Images; using DockerUpdateGuard.Images.Data; @@ -364,5 +365,120 @@ public async Task DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexHas Assert.AreEqual("The .NET release index does not contain a valid releases-index array", result.Message, "The failure must name the missing array"); } + /// + /// Verify an index whose root is not a JSON object reports the fixed invalid-response reason + /// + /// Index body + /// Task + [TestMethod] + [TestCategory("AC1")] + [DataRow("[]")] + [DataRow("\"text\"")] + [DataRow("42")] + [DataRow("true")] + [DataRow("false")] + [DataRow("null")] + public async Task DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexRootIsNotAnObjectReportsInvalidResponseAsync(string body) + { + using var handler = new StaticHttpJsonMessageHandler(body); + using var httpClient = new HttpClient(handler) + { + BaseAddress = new Uri("https://dotnet.example.test/"), + }; + var service = new DotNetReleaseMetadataService(httpClient, new TestLogger()); + + var result = await service.GetChannelReleaseAsync("9.0", TestContext.CancellationToken) + .ConfigureAwait(false); + + Assert.AreEqual(ExternalOperationStatus.Failed, result.Status, "An index whose root is not an object must fail the lookup"); + Assert.AreEqual("Loading .NET release metadata failed: invalid response", result.Message, "A root that is not an object must report the fixed invalid-response reason"); + } + + /// + /// Verify an index whose root is not a JSON object is logged with the fixed refusal and no inner exception + /// + /// Task + [TestMethod] + [TestCategory("AC1")] + public async Task DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexRootIsNotAnObjectLogsFixedRefusalAsync() + { + var logger = new TestLogger(); + + using var handler = new StaticHttpJsonMessageHandler("[]"); + using var httpClient = new HttpClient(handler) + { + BaseAddress = new Uri("https://dotnet.example.test/"), + }; + var service = new DotNetReleaseMetadataService(httpClient, logger); + + await service.GetChannelReleaseAsync("9.0", TestContext.CancellationToken).ConfigureAwait(false); + + var loadFailure = Assert.ContainsSingle(entry => entry.EventId.Id == 2101, + logger.Entries, + "A root that is not an object must be logged once as load failure 2101"); + + Assert.IsInstanceOfType(loadFailure.Exception, "The warning must carry the refusal of a root that is not an object"); + Assert.AreEqual("The remote response is not a JSON object", loadFailure.Exception.Message, "The refusal must carry its fixed message"); + Assert.IsNull(loadFailure.Exception.InnerException, "The refusal must carry no inner exception"); + } + + /// + /// Verify an index with a string that does not decode reports the fixed invalid-response reason + /// + /// Index body + /// Task + [TestMethod] + [TestCategory("AC2")] + [DataRow("""{"releases-index":[{"channel-version":"9\ud800","latest-runtime":"9.0.15"}]}""")] + [DataRow("""{"releases-index":[{"channel-version":"9.0","latest-runtime":"9.0.15","unread":"a\ud800b"}]}""")] + public async Task DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexStringDoesNotDecodeReportsInvalidResponseAsync(string body) + { + Assert.Contains("\\ud800", body, "The test input must carry the escaped lone surrogate"); + + using var handler = new StaticHttpJsonMessageHandler(body); + using var httpClient = new HttpClient(handler) + { + BaseAddress = new Uri("https://dotnet.example.test/"), + }; + var service = new DotNetReleaseMetadataService(httpClient, new TestLogger()); + + var result = await service.GetChannelReleaseAsync("9.0", TestContext.CancellationToken) + .ConfigureAwait(false); + + Assert.AreEqual(ExternalOperationStatus.Failed, result.Status, "A string that does not decode must fail the lookup"); + Assert.AreEqual("Loading .NET release metadata failed: invalid response", result.Message, "A string that does not decode must report the fixed invalid-response reason"); + } + + /// + /// Verify an index entry that is not a JSON object is left out and a valid entry beside it is returned + /// + /// Entry that is not an object + /// Task + [TestMethod] + [TestCategory("AC3")] + [DataRow("42")] + [DataRow("\"text\"")] + [DataRow("[]")] + [DataRow("null")] + [DataRow("true")] + public async Task DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexEntryIsNotAnObjectLeavesItOutAsync(string entry) + { + var body = $$"""{"releases-index":[{{entry}},{"channel-version":"9.0","latest-runtime":"9.0.15"}]}"""; + + using var handler = new StaticHttpJsonMessageHandler(body); + using var httpClient = new HttpClient(handler) + { + BaseAddress = new Uri("https://dotnet.example.test/"), + }; + var service = new DotNetReleaseMetadataService(httpClient, new TestLogger()); + + var result = await service.GetChannelReleaseAsync("9.0", TestContext.CancellationToken) + .ConfigureAwait(false); + + Assert.AreEqual(ExternalOperationStatus.Succeeded, result.Status, "An entry that is not an object must not fail the index"); + Assert.IsNotNull(result.Data, "The valid entry beside it must be returned"); + Assert.AreEqual(new Version(9, 0, 15), result.Data.LatestRuntimeVersion, "The valid entry must carry its latest runtime"); + } + #endregion // Methods } \ No newline at end of file From 5da80c590f7465636414117955e89ccbb1d64577 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:32:20 +0000 Subject: [PATCH 09/15] Parse the .NET release index as a remote JSON object --- docs/areas/base-images.md | 7 +++++-- docs/areas/integration-failures.md | 8 +++++--- docs/areas/telemetry.md | 2 +- specs/issue-587/log.md | 1 + .../Images/DotNetReleaseMetadataService.cs | 9 +++++++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/areas/base-images.md b/docs/areas/base-images.md index 6da57376..aead8a01 100644 --- a/docs/areas/base-images.md +++ b/docs/areas/base-images.md @@ -108,7 +108,8 @@ a base-image update or vulnerability reaches; vulnerability refreshes and the da - **.NET:** `releases-index.json` under `DockerUpdateGuard:ReleaseMetadata:DotNetBaseUrl` (default `https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/`). Per channel (`channel-version`) the latest - runtime (`latest-runtime`) and whether that release is a security release (`security`). + runtime (`latest-runtime`) and whether that release is a security release (`security`). An entry of `releases-index` + that is not a JSON object is left out; the other entries still count. - **nginx:** the `download/` page under `DockerUpdateGuard:ReleaseMetadata:NginxBaseUrl` (default `https://nginx.org/`). Every `nginx-x.y.z.tar.gz` link counts; a channel's latest is its highest version. - Both URLs are fixed at startup and must be absolute `http`/`https` URLs without an `@` outside their user info ([Hosting](hosting.md)). A feed is loaded at @@ -140,12 +141,14 @@ a base-image update or vulnerability reaches; vulnerability refreshes and the da - Chain depth is capped at 5; base-tag resolution searches at most 150 tags. - Registry outcomes other than *succeeded* never abort the scan; they set *partial* or *failed* and add the registry's message (status code and an excerpt of the response body, see [Integration failures](integration-failures.md#excerpts-of-remote-text)). -- Feed failures (non-success status, missing `releases-index` array, unreadable content) only suppress the runtime +- Feed failures (non-success status, missing `releases-index` array, unreadable content: malformed JSON, a string that does not decode, or a root that is + not a JSON object) only suppress the runtime finding and keep the previous one (observed image and running container); they do not change the scan status. Unreadable content is logged as a warning. ## Related decisions +- [0076: The .NET release index is parsed as a remote JSON object, and an entry that is not one is left out](../decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md) - [0054: A base image is shared from two users among enabled observed images and their containers](../decisions/0054-a-base-image-is-shared-from-two-users-among-enabled-observed-images-and-their-containers.md) - [0042: A runtime container keeps its derived runtime finding while its runtime check cannot be completed](../decisions/0042-a-runtime-container-keeps-its-derived-runtime-finding-while-its-runtime-check-cannot-be-completed.md) diff --git a/docs/areas/integration-failures.md b/docs/areas/integration-failures.md index 3f9b3258..98653f02 100644 --- a/docs/areas/integration-failures.md +++ b/docs/areas/integration-failures.md @@ -31,10 +31,10 @@ operator's logs rely on it; each integration area states only what it adds. failed` (transport failures and responses that break off), `invalid response` or `unexpected error`. The error itself is logged with the failure (a JSON parse failure with a fixed message, [Telemetry](telemetry.md#credentials-and-external-data)). - `invalid response` covers malformed JSON and a JSON string that does not decode as Unicode text, such as a lone - surrogate escape like `\ud800` or bytes that are not UTF-8, a registry answer, or a Docker Engine stats or image inspect answer, whose root is not a JSON object, a Docker Engine container list or image history whose root is not a JSON array, and a Docker Hub access token whose payload segment is not - base64url. The Docker Hub, OCI and Docker Engine clients refuse the + surrogate escape like `\ud800` or bytes that are not UTF-8, a registry answer, a Docker Engine stats or image inspect answer, or the .NET release index, whose root is not a JSON object, a Docker Engine container list or image history whose root is not a JSON array, and a Docker Hub access token whose payload segment is not + base64url. The Docker Hub, OCI and Docker Engine clients and the .NET release feed refuse the whole body for one in any string value or property name; the Portainer client and the vulnerability providers for one - in a field they read; the release feeds report it as `unexpected error`. + in a field they read. - A message the application composed itself from fixed text, configuration names and masked URLs ([Telemetry](telemetry.md#credentials-and-external-data)), and for a rejected registration the stored name of an own image with its control characters replaced, is passed on as it is; it never contains an error's own @@ -185,6 +185,8 @@ negative or an unreadable number is unknown), and the .NET release feed's `lates remembered process-wide. - [0019](../decisions/0019-remote-json-with-undecodable-strings-is-an-invalid-response.md): remote JSON with a string that does not decode is an invalid response. +- [0076](../decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md): the .NET + release index is parsed as a remote JSON object and an entry that is not one is left out. - [0029](../decisions/0029-registry-calls-answer-every-error-but-the-callers-cancellation-as-failed.md): registry calls answer every error but the caller's cancellation as *failed*. - [0066](../decisions/0066-remote-timestamps-without-an-offset-are-read-as-utc.md): remote timestamps without an diff --git a/docs/areas/telemetry.md b/docs/areas/telemetry.md index 8aa05a6e..bff35691 100644 --- a/docs/areas/telemetry.md +++ b/docs/areas/telemetry.md @@ -122,7 +122,7 @@ Every exported signal carries the same resource: - A JSON parse failure of a remote answer, a token payload, the .NET release index or Trivy's report is logged with a fixed message, never the parser's: `Remote JSON is not valid at line , byte (counted from 0)`, with the parser's line and byte position in invariant digits, or `Remote JSON is not valid` when the position is unknown. The - exception has no path and no inner exception, so it carries no remote text; the refusal of a string that does not decode ([Integration failures](integration-failures.md#fixed-failure-reasons)) keeps its own fixed message and its decoding error, which carries no remote text either; the refusal of a registry answer, or of a Docker Engine stats or image inspect answer, whose root is not a JSON object carries the fixed message `The remote response is not a JSON object` and no inner exception; the refusal of a Docker Engine container list or image history whose root is not a JSON array carries `The remote response is not a JSON array` and no inner exception. Every parse of external JSON goes through + exception has no path and no inner exception, so it carries no remote text; the refusal of a string that does not decode ([Integration failures](integration-failures.md#fixed-failure-reasons)) keeps its own fixed message and its decoding error, which carries no remote text either; the refusal of a registry answer, of a Docker Engine stats or image inspect answer, or of the .NET release index, whose root is not a JSON object carries the fixed message `The remote response is not a JSON object` and no inner exception; the refusal of a Docker Engine container list or image history whose root is not a JSON array carries `The remote response is not a JSON array` and no inner exception. Every parse of external JSON goes through `Infrastructure\ExternalJson`. A `Content-Type` charset that cannot be used is refused with the fixed message `The character set of the remote response is not valid` and no inner exception. Decision: [0045](../decisions/0045-json-parse-failures-of-external-data-carry-a-fixed-message-with-their-position.md). diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index fa7e13eb..bfcbe700 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -12,3 +12,4 @@ are quoted in full. | 2026-11-28 16:25 | 2 Plan revise (security notes) | Lead | RESULT: DONE, area added, Security review section (opus/medium · 4,041 tokens · 4 tool uses · 19 s · 10 in · 1,107 out · 488,220 cache read · 5,178 cache write · 72,857 weighted · continued) | | 2026-11-28 16:25 | 3 Plan security delta | Security | VERDICT: APPROVED (opus/medium · 3,119 tokens · 2 tool uses · 10 s · 6 in · 610 out · 88,222 cache read · 4,305 cache write · 25,697 weighted · continued) | | 2026-11-28 16:28 | 5 Tests first | Tester | RESULT: PASS, 14 new cases fail on current code (verified by Orchestrator), 10 existing pass. Deferred: none (sonnet/medium · 105,634 tokens · 10 tool uses · 141 s · 18 in · 5,486 out · 772,825 cache read · 104,652 cache write · 235,546 weighted) | +| 2026-11-28 16:32 | 6 Implement | Dev | RESULT: DONE, suite green, Coverage gate 100% of changed lines, Analyzer gate clean, docs written (sonnet/medium · 105,084 tokens · 20 tool uses · 226 s · 36 in · 5,921 out · 1,664,493 cache read · 52,316 cache write · 261,485 weighted) | diff --git a/src/DockerUpdateGuard/Images/DotNetReleaseMetadataService.cs b/src/DockerUpdateGuard/Images/DotNetReleaseMetadataService.cs index ea16cf61..28313b8f 100644 --- a/src/DockerUpdateGuard/Images/DotNetReleaseMetadataService.cs +++ b/src/DockerUpdateGuard/Images/DotNetReleaseMetadataService.cs @@ -152,8 +152,8 @@ private async Task> LoadIndexAsync(CancellationTok await using (responseStream.ConfigureAwait(false)) { - using var jsonDocument = await ExternalJson.ParseAsync(responseStream, cancellationToken) - .ConfigureAwait(false); + using var jsonDocument = await RemoteJsonDocument.ParseObjectAsync(responseStream, cancellationToken) + .ConfigureAwait(false); if (jsonDocument.RootElement.TryGetProperty("releases-index", out var releasesIndexElement) == false || releasesIndexElement.ValueKind != JsonValueKind.Array) @@ -163,6 +163,11 @@ private async Task> LoadIndexAsync(CancellationTok foreach (var releaseElement in releasesIndexElement.EnumerateArray()) { + if (releaseElement.ValueKind != JsonValueKind.Object) + { + continue; + } + var channelVersion = TryGetString(releaseElement, "channel-version"); var latestRuntime = TryGetString(releaseElement, "latest-runtime"); From a045f89b1b24a7988e4dab76c79e225a9d7adad2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:33:19 +0000 Subject: [PATCH 10/15] Log implement steps for issue 587 --- specs/issue-587/log.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index bfcbe700..1ec9e7e0 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -13,3 +13,5 @@ are quoted in full. | 2026-11-28 16:25 | 3 Plan security delta | Security | VERDICT: APPROVED (opus/medium · 3,119 tokens · 2 tool uses · 10 s · 6 in · 610 out · 88,222 cache read · 4,305 cache write · 25,697 weighted · continued) | | 2026-11-28 16:28 | 5 Tests first | Tester | RESULT: PASS, 14 new cases fail on current code (verified by Orchestrator), 10 existing pass. Deferred: none (sonnet/medium · 105,634 tokens · 10 tool uses · 141 s · 18 in · 5,486 out · 772,825 cache read · 104,652 cache write · 235,546 weighted) | | 2026-11-28 16:32 | 6 Implement | Dev | RESULT: DONE, suite green, Coverage gate 100% of changed lines, Analyzer gate clean, docs written (sonnet/medium · 105,084 tokens · 20 tool uses · 226 s · 36 in · 5,921 out · 1,664,493 cache read · 52,316 cache write · 261,485 weighted) | +| 2026-11-28 16:33 | 6 Coverage skipped | Orchestrator | skipped — Coverage gate passes (100% of 3 changed lines, 2/2 conditions), no uncovered lines, nothing deferred | +| 2026-11-28 16:33 | 6 Documentation | Orchestrator | written in 6 Implement | From b384aefff773556ea85e23a9cadf08bcb119459a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:34:27 +0000 Subject: [PATCH 11/15] Gate stamp for issue 587 --- specs/issue-587/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index 1ec9e7e0..324442f9 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -15,3 +15,4 @@ are quoted in full. | 2026-11-28 16:32 | 6 Implement | Dev | RESULT: DONE, suite green, Coverage gate 100% of changed lines, Analyzer gate clean, docs written (sonnet/medium · 105,084 tokens · 20 tool uses · 226 s · 36 in · 5,921 out · 1,664,493 cache read · 52,316 cache write · 261,485 weighted) | | 2026-11-28 16:33 | 6 Coverage skipped | Orchestrator | skipped — Coverage gate passes (100% of 3 changed lines, 2/2 conditions), no uncovered lines, nothing deferred | | 2026-11-28 16:33 | 6 Documentation | Orchestrator | written in 6 Implement | +| 2026-11-28 16:34 | 7 Gate stamp | Orchestrator | PASS on a045f89b1b24a7988e4dab76c79e225a9d7adad2 (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 0 hit(s) | From 7037e495692799149edfad922f040e9da16ef477 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:35:33 +0000 Subject: [PATCH 12/15] Log review for issue 587 --- specs/issue-587/log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index 324442f9..59fe6ccd 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -16,3 +16,4 @@ are quoted in full. | 2026-11-28 16:33 | 6 Coverage skipped | Orchestrator | skipped — Coverage gate passes (100% of 3 changed lines, 2/2 conditions), no uncovered lines, nothing deferred | | 2026-11-28 16:33 | 6 Documentation | Orchestrator | written in 6 Implement | | 2026-11-28 16:34 | 7 Gate stamp | Orchestrator | PASS on a045f89b1b24a7988e4dab76c79e225a9d7adad2 (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 0 hit(s) | +| 2026-11-28 16:35 | 8 Review | Reviewer | VERDICT: APPROVE on a045f89b1b24a7988e4dab76c79e225a9d7adad2 (opus/medium · 52,052 tokens · 9 tool uses · 59 s · 18 in · 4,445 out · 335,167 cache read · 50,049 cache write · 203,125 weighted) | From ba3c9d61256cea93056fbefd2e85b2aee6627305 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:35:41 +0000 Subject: [PATCH 13/15] Accept decision record 0076 --- ...mote-json-object-and-an-entry-that-is-not-one-is-left-out.md | 2 +- docs/decisions/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md b/docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md index ff92a366..ffc42314 100644 --- a/docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md +++ b/docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md @@ -1,6 +1,6 @@ # 0076: The .NET release index is parsed as a remote JSON object, and an entry that is not one is left out -- **Status:** Proposed +- **Status:** Accepted - **Date:** 2026-11-28 - **Area:** Base images - **Source:** Issue #587 diff --git a/docs/decisions/README.md b/docs/decisions/README.md index 4fdc3e08..1563d0d8 100644 --- a/docs/decisions/README.md +++ b/docs/decisions/README.md @@ -136,5 +136,5 @@ once in the [area document](../areas/README.md) of the record's area, and the re | [0073](0073-a-registry-answer-that-is-not-a-json-object-is-an-invalid-response-and-an-entry-that-is-not-one-is-left-out.md) | A registry answer that is not a JSON object is an invalid response, and an entry that is not one is left out | Accepted | 2026-11-28 | | [0074](0074-a-docker-engine-stats-or-image-inspect-answer-that-is-not-a-json-object-is-an-invalid-response.md) | A Docker Engine stats or image inspect answer that is not a JSON object is an invalid response | Accepted | 2026-11-28 | | [0075](0075-a-docker-engine-container-list-or-image-history-that-is-not-a-json-array-is-an-invalid-response.md) | A Docker Engine container list or image history that is not a JSON array is an invalid response | Accepted | 2026-11-28 | -| [0076](0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md) | The .NET release index is parsed as a remote JSON object, and an entry that is not one is left out | Proposed | 2026-11-28 | +| [0076](0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md) | The .NET release index is parsed as a remote JSON object, and an entry that is not one is left out | Accepted | 2026-11-28 | \ No newline at end of file From 6612464de90ac9f9e1e8f323184b72e4c9c0640c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:35:53 +0000 Subject: [PATCH 14/15] Approve PR of issue 587 --- specs/issue-587/log.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md index 59fe6ccd..4d7086ce 100644 --- a/specs/issue-587/log.md +++ b/specs/issue-587/log.md @@ -17,3 +17,5 @@ are quoted in full. | 2026-11-28 16:33 | 6 Documentation | Orchestrator | written in 6 Implement | | 2026-11-28 16:34 | 7 Gate stamp | Orchestrator | PASS on a045f89b1b24a7988e4dab76c79e225a9d7adad2 (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 0 hit(s) | | 2026-11-28 16:35 | 8 Review | Reviewer | VERDICT: APPROVE on a045f89b1b24a7988e4dab76c79e225a9d7adad2 (opus/medium · 52,052 tokens · 9 tool uses · 59 s · 18 in · 4,445 out · 335,167 cache read · 50,049 cache write · 203,125 weighted) | +| 2026-11-28 16:35 | 7 Gate stamp | Orchestrator | PASS on ba3c9d61256cea93056fbefd2e85b2aee6627305 (tier standard, verbatim): Format check pass; decision-check.py pass; scope-check.py pass | +| 2026-11-28 16:35 | 9 PR approval | Orchestrator | approved by checklist | From d565ddb7dac93fd353b8b00d0eac7c4bc8702404 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 16:36:16 +0000 Subject: [PATCH 15/15] Remove squad working record --- specs/issue-587/log.md | 21 ----- specs/issue-587/plan.md | 190 ---------------------------------------- 2 files changed, 211 deletions(-) delete mode 100644 specs/issue-587/log.md delete mode 100644 specs/issue-587/plan.md diff --git a/specs/issue-587/log.md b/specs/issue-587/log.md deleted file mode 100644 index 4d7086ce..00000000 --- a/specs/issue-587/log.md +++ /dev/null @@ -1,21 +0,0 @@ -# Log: Issue #587 - -One line per pipeline step: date and time of day (UTC), step, member, result. Lead decisions and escalations -are quoted in full. - -| Date | Step | Member | Result | -| ---- | ---- | ------ | ------ | -| 2026-11-28 16:19 | 1 Intake | Orchestrator | Bug, open, no comments; branch claude/admiring-sagan-njkqq9 off main 70f80f7 | -| 2026-11-28 16:23 | 2 Plan | Lead | RESULT: DONE, tier standard, plan.md and decision record 0076 (opus/medium · 121,247 tokens · 28 tool uses · 218 s · 44 in · 19,965 out · 1,763,848 cache read · 119,722 cache write · 675,428 weighted) | -| 2026-11-28 16:24 | 2 Plan challenge | Devil's Advocate | VERDICT: NO OBJECTIONS (opus/medium · 41,705 tokens · 8 tool uses · 44 s · 16 in · 3,291 out · 232,833 cache read · 40,339 cache write · 157,073 weighted) | -| 2026-11-28 16:24 | 3 Plan security | Security | VERDICT: APPROVED; one non-blocking finding: add area 'Logging and telemetry of external data' to Security areas touched (opus/medium · 44,841 tokens · 8 tool uses · 67 s · 16 in · 4,773 out · 240,606 cache read · 43,161 cache write · 179,725 weighted) | -| 2026-11-28 16:25 | 2 Plan revise (security notes) | Lead | RESULT: DONE, area added, Security review section (opus/medium · 4,041 tokens · 4 tool uses · 19 s · 10 in · 1,107 out · 488,220 cache read · 5,178 cache write · 72,857 weighted · continued) | -| 2026-11-28 16:25 | 3 Plan security delta | Security | VERDICT: APPROVED (opus/medium · 3,119 tokens · 2 tool uses · 10 s · 6 in · 610 out · 88,222 cache read · 4,305 cache write · 25,697 weighted · continued) | -| 2026-11-28 16:28 | 5 Tests first | Tester | RESULT: PASS, 14 new cases fail on current code (verified by Orchestrator), 10 existing pass. Deferred: none (sonnet/medium · 105,634 tokens · 10 tool uses · 141 s · 18 in · 5,486 out · 772,825 cache read · 104,652 cache write · 235,546 weighted) | -| 2026-11-28 16:32 | 6 Implement | Dev | RESULT: DONE, suite green, Coverage gate 100% of changed lines, Analyzer gate clean, docs written (sonnet/medium · 105,084 tokens · 20 tool uses · 226 s · 36 in · 5,921 out · 1,664,493 cache read · 52,316 cache write · 261,485 weighted) | -| 2026-11-28 16:33 | 6 Coverage skipped | Orchestrator | skipped — Coverage gate passes (100% of 3 changed lines, 2/2 conditions), no uncovered lines, nothing deferred | -| 2026-11-28 16:33 | 6 Documentation | Orchestrator | written in 6 Implement | -| 2026-11-28 16:34 | 7 Gate stamp | Orchestrator | PASS on a045f89b1b24a7988e4dab76c79e225a9d7adad2 (tier standard): Format check pass; Analyzer gate pass; Test with coverage pass; Coverage gate pass; decision-check.py pass; scope-check.py pass · figure-check.py 0 hit(s) | -| 2026-11-28 16:35 | 8 Review | Reviewer | VERDICT: APPROVE on a045f89b1b24a7988e4dab76c79e225a9d7adad2 (opus/medium · 52,052 tokens · 9 tool uses · 59 s · 18 in · 4,445 out · 335,167 cache read · 50,049 cache write · 203,125 weighted) | -| 2026-11-28 16:35 | 7 Gate stamp | Orchestrator | PASS on ba3c9d61256cea93056fbefd2e85b2aee6627305 (tier standard, verbatim): Format check pass; decision-check.py pass; scope-check.py pass | -| 2026-11-28 16:35 | 9 PR approval | Orchestrator | approved by checklist | diff --git a/specs/issue-587/plan.md b/specs/issue-587/plan.md deleted file mode 100644 index 52159bfb..00000000 --- a/specs/issue-587/plan.md +++ /dev/null @@ -1,190 +0,0 @@ -# Plan: A .NET release index whose root is not a JSON object reads `invalid response` - -Source: Issue #587 -Tier: standard — the .NET release feed answers a different fixed reason for malformed bodies and skips malformed index entries (a behavior change of input handling, no security control created, changed or removed). -Security areas touched: Failure messages and remote text (the fixed reason the .NET release feed's result carries and the exception its load-failure warning 2101 logs; no file listed for the area changes); Logging and telemetry of external data (the exception warning 2101 logs for the .NET release index; no log call changes) - -## Problem / root cause - -`DotNetReleaseMetadataService.LoadIndexAsync` (`src/DockerUpdateGuard/Images/DotNetReleaseMetadataService.cs`) parses -the index with `ExternalJson.ParseAsync` (line 155) and calls `RootElement.TryGetProperty` (line 158) without checking -the root's kind. `JsonElement.TryGetProperty` throws `InvalidOperationException` on any element that is not an object, -so a root that is an array, string, number, `true`, `false` or `null` reaches the catch at lines 193-197, and -`FailureReason.FromException` maps it to `unexpected error` (only `JsonException` maps to `invalid response`). The -Docker Hub, OCI and Docker Engine clients answer `invalid response` for the same body because they parse with -`RemoteJsonDocument.ParseObjectAsync` (records 0073, 0074). - -Two related defects on the same path, found while planning: - -- **An entry of `releases-index` that is not a JSON object** (line 164-167: `TryGetString(releaseElement, …)` calls - `TryGetProperty` on it) throws the same `InvalidOperationException`, so one such entry fails the whole index with - `unexpected error`. Every other client leaves such an entry out (records 0069, 0073). -- **A JSON string that does not decode** (a lone surrogate escape `\ud800`) in a field the service reads throws - `InvalidOperationException` from `GetString()` (record 0019) and also reads `unexpected error`; record 0019 left the - release feeds out on purpose ("their text reaches no message"). - -## Verified facts - -| # | Claim | Evidence | Status | -| - | ----- | -------- | ------ | -| 1 | The index is parsed with `ExternalJson.ParseAsync` and `TryGetProperty` is called on the root without a kind check | `DotNetReleaseMetadataService.cs` lines 155-159 | confirmed | -| 2 | `JsonElement.TryGetProperty` and `GetString()` throw `InvalidOperationException` on a non-object element and on an undecodable string | .NET API documentation of `JsonElement.TryGetProperty` (throws when `ValueKind` is not `Object`); records 0019 (measured for `GetString()`), 0074 and 0075 (same throw on Engine roots) | confirmed | -| 3 | The catch maps every exception through `FailureReason.FromException`; only `JsonException` gives `invalid response`, an `InvalidOperationException` gives `unexpected error` | `DotNetReleaseMetadataService.cs` lines 193-197; `Infrastructure/FailureReason.cs` lines 78-83 | confirmed | -| 4 | The Docker Hub, OCI and Docker Engine clients answer `invalid response` for a non-object root | `RemoteJsonDocument.ParseObjectAsync` throws `JsonException("The remote response is not a JSON object")` (`RemoteJsonDocument.cs` lines 61-97), used in `DockerHubClient.cs`, `OciRegistryClient.cs`, `DockerInstanceClient.cs` (lines 499, 869) | confirmed | -| 5 | `RemoteJsonDocument.ParseObjectAsync` keeps the fixed parse-failure message of `ExternalJson` for malformed JSON | it calls `ParseAsync`, which calls `ExternalJson.ParseAsync` (`RemoteJsonDocument.cs` lines 37-53, 87) | confirmed | -| 6 | A non-object entry of `releases-index` throws as well | lines 164-167: `TryGetString` → `TryGetProperty` on the entry | confirmed | -| 7 | The failure message reaches no page or scan run: both orchestrators only test the status and return | `ImageScanOrchestrator.cs` lines 387-393 (the runtime orchestrator likewise); the exception is logged by warning 2101 (`ImageHostLoggingExtensions.cs` line 781) | confirmed | -| 8 | The nginx feed parses no JSON (it reads the `download/` page as text), so "the release feeds" in record 0019 and the area document mean the .NET feed only | `NginxReleaseMetadataService.cs` line 130 (`ReadAsStringAsync`), no JSON call in the file | confirmed | -| 9 | Record 0019 is released, so it is amended by a new record, not edited | its commit is in `v1.3.10` (`git tag --contains`) | confirmed | - -## Acceptance criteria - -- AC1: An index whose root is a JSON array, string, number, `true`, `false` or `null` makes `GetChannelReleaseAsync` - answer *failed* with the message `Loading .NET release metadata failed: invalid response` (decided by - `FailureReason.FromException` on the `JsonException` of `RemoteJsonDocument.ParseObjectAsync`), and warning 2101 logs - a `JsonException` with the message `The remote response is not a JSON object` and no inner exception. -- AC2: An index with a JSON string that does not decode (the escape `\ud800` written in the JSON text) — in a field the - service reads (`channel-version`) and in one it does not read — answers *failed* with - `Loading .NET release metadata failed: invalid response`. The test asserts that its input still contains the - backslash of the escape (`.squad/team.md`, *Escapes in files*). -- AC3: An entry of `releases-index` that is not a JSON object (a number, a string, an array, `null`, `true`) is left - out, and a valid entry beside it is still returned: the lookup of its channel *succeeded* with its latest runtime. - -## Tests per criterion - -| AC | Test(s) | Test file | -| -- | ------- | --------- | -| AC1 | `DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexRootIsNotAnObjectReportsInvalidResponseAsync` (one `DataRow` per kind: `[]`, `"text"`, `42`, `true`, `false`, `null`); `DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexRootIsNotAnObjectLogsFixedRefusalAsync` | `src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs` | -| AC2 | `DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexStringDoesNotDecodeReportsInvalidResponseAsync` (`DataRow` for the read and the unread field) | `src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs` | -| AC3 | `DotNetReleaseMetadataServiceGetChannelReleaseAsyncWhenIndexEntryIsNotAnObjectLeavesItOutAsync` (one `DataRow` per kind, the entry placed before a valid `9.0` entry) | `src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs` | - -## Approach - -In `LoadIndexAsync`: - -1. Replace `ExternalJson.ParseAsync(responseStream, cancellationToken)` (line 155) by - `RemoteJsonDocument.ParseObjectAsync(responseStream, cancellationToken)`. A non-object root and an undecodable - string then raise `JsonException`, which the existing catch maps to `invalid response`; malformed JSON keeps its - fixed message. The check for the `releases-index` array (lines 158-162) and its message stay as they are. -2. In the loop, leave out an entry whose `ValueKind` is not `JsonValueKind.Object` (`continue`), before any property - is read — as one more condition of the existing skip at line 169, or a guard of its own above it. - -No new message, no new log event, no new type or member. - -Early draft PR: no — every criterion is a unit test - -## Options considered - -1. **Parse with `RemoteJsonDocument.ParseObjectAsync` and leave out non-object entries (chosen)** — the rule of - records 0073-0075 for the same kind of answer, through the one helper that already holds it; malformed roots and - undecodable strings read `invalid response` as in every other `JsonDocument` client. -2. **Check the root kind after `ExternalJson.ParseAsync` and answer the existing message `The .NET release index does - not contain a valid releases-index array`** — literally true for a non-object root, but that message describes a - well-formed index without the field, it differs from the reason the other clients give for the same body, and it - leaves undecodable strings at `unexpected error`. -3. **A root check of its own that throws `JsonException`, without the string decoding** — keeps today's tolerance of an - undecodable string in a field the service never reads, but leaves `unexpected error` for one it reads and copies - the check `RemoteJsonDocument` holds once (record 0075, option 4). -4. **Keep `unexpected error`** — two reasons for one malformed body, depending on which integration received it; the - reason reads like an error of the application (record 0074, option 2). -5. **Map `InvalidOperationException` to `invalid response` in `FailureReason`** — rejected by records 0019 and 0029: - the runtime raises it for unrelated misuse too. -6. **Refuse the whole index for a non-object entry** — the other entries still carry data; every other client leaves - such an entry out (records 0069, 0073). - -## Affected projects and types - -| Project | Type / file | Change | -| ------- | ----------- | ------ | -| `DockerUpdateGuard` | `Images/DotNetReleaseMetadataService.cs` | parse call and entry guard in `LoadIndexAsync` | -| `DockerUpdateGuard.Tests` | `DotNetReleaseMetadataServiceTests.cs` | the tests of *Tests per criterion* | - -## Signatures (for the Dev's skeleton) - -None: no API member is added or changed, so step 4 is skipped. `DotNetReleaseMetadataService.cs` is the only -production file the fix rewrites. - -## Test files - -`src/Tests/DockerUpdateGuard.Tests/DotNetReleaseMetadataServiceTests.cs` (new tests in the existing class). - -Existing test code that calls a changed signature: none. The existing tests of the class stay unchanged: none has an -input the criteria handle differently (malformed JSON, `{}` and `{"releases-index": []}` are object roots or parse -failures and keep their messages; their entries are objects). - -Files of the change no unit test can cover: none. - -## Areas - -- `docs/areas/integration-failures.md` (+20 words): *Fixed failure reasons* — the .NET release index joins the list of - answers whose root is not a JSON object; "the release feeds report it as `unexpected error`" becomes that the .NET - release feed refuses the whole index as well; *Related decisions* gains 0076. -- `docs/areas/base-images.md` (+45 words): *Release feeds and runtime findings*, the .NET bullet — an entry of - `releases-index` that is not a JSON object is left out; *Limits and errors* — "unreadable content" names malformed - JSON, a string that does not decode and a root that is not a JSON object; *Related decisions* gains 0076. -- `docs/areas/telemetry.md` (+5 words): *Credentials and external data* — the refusal with `The remote response is not - a JSON object` also covers the .NET release index. - -## Documentation updates - -The three area documents above, by the Dev, against the code as built. `docs/ARCHITECTURE.md`, `README.md` and -`.squad/project.md` need no change: the `ExternalJson`/`RemoteJsonDocument` sentences stay true, no setting changes. -No changelog file exists; the release-notes label is the orchestrator's (step 10). - -## Architecture check - -The guarantee of fixed failure reasons (record 0009, ARCHITECTURE.md *Integration failures*) is kept: the message -still carries only a fixed reason, now the more precise one. External JSON still passes `ExternalJson`, beneath -`RemoteJsonDocument`. No guarantee of `.squad/project.md` is weakened. - -## Security considerations - -- [x] No limits: the index is read whole as before. -- [x] Exceptions that reach a failure reason: `JsonException` (malformed JSON, undecodable string, non-object root) → - `invalid response`; every other exception as before. Warning 2101 logs the refusal's fixed message - (`The remote response is not a JSON object`, or the undecodable-string message with its decoding error), never - remote text. - -## Decision records - -- `docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md` - (Proposed) — amends 0019's consequence that the release feeds keep `unexpected error`. - -## Out of scope / follow-ups - -- The nginx feed (HTML text, no JSON) is unaffected. - -## Security notes - -Security plan review: specs/issue-587 (`/home/user/DockerUpdateGuard/specs/issue-587/plan.md`, `/home/user/DockerUpdateGuard/docs/decisions/0076-the-dotnet-release-index-is-parsed-as-a-remote-json-object-and-an-entry-that-is-not-one-is-left-out.md`) - -The plan is approved. I found no blocking issues and one non-blocking one. - -**Tier is right at `standard`.** The change swaps `ExternalJson.ParseAsync` for `RemoteJsonDocument.ParseObjectAsync` and skips entries of `releases-index` that are not JSON objects. That is a parser's validation that only keeps malformed input from breaking the program, which the `security` row of *Tiers* (`.squad/routing.md` line 100) classes as input handling. It is not a guard that limits what an attacker can reach. It adds no new path, URL, credential or listener. The `releases.json` URL taken from each entry is read the same way as before. - -**What I checked by reading the code** -- `RemoteJsonDocument.ParseRootAsync` (`src/DockerUpdateGuard/Infrastructure/RemoteJsonDocument.cs` lines 85-97) throws `JsonException("The remote response is not a JSON object")` with no inner exception, and disposes the document first. `RemoteJsonDocumentTests.cs` lines 174-175 already test this. -- For malformed JSON, the fixed `ExternalJson` message is kept (lines 37-53). -- `EnsureStringsDecode` recursion is limited by the default `JsonDocument` maximum depth of 64, because the parse fails before the walk on anything deeper. It allocates nothing that is kept, since each decoded string is thrown away. "No limits" is therefore accurate: the index is held whole as before. -- Every exception still goes through the existing catch at `DotNetReleaseMetadataService.cs` lines 193-197. The result carries only the fixed reason. Warning 2101 (`ImageHostLoggingExtensions.cs`) has no message parameters, only the exception. -- The entry guard (`ValueKind != Object` → `continue`, placed before any property is read) closes every remaining path to `InvalidOperationException` from `TryGetProperty`. That leaves the root, the entries, and `GetString` on strings that are already decoded. - -**Measurement.** The security consideration says the logged decoding error carries no remote text. That rests on library behavior, and the change now also logs it for strings in fields the service never reads. So I measured it on .NET SDK 11.0.100 with a file-based program in `/tmp/claude-0/-home-user-DockerUpdateGuard/706e9084-0cbd-583b-a79c-d9b87f2dff75/scratchpad/m/m.cs`, run as `dotnet run m.cs`. It calls `JsonDocument.Parse`, then `GetString()` on `"SECRETTEXT\ud800SECRET"` and `"abc\udc00def"`. Output: -``` -InvalidOperationException: Cannot read incomplete UTF-16 JSON text as string with missing low surrogate. | inner: : -InvalidOperationException: Cannot read invalid UTF-16 JSON text as string. Invalid surrogate value: '0xDC00'. | inner: : -``` -Neither message contains the surrounding remote text: at most the surrogate's code-unit value, and no inner exception. So the claim holds, and so does the matching sentence in `docs/areas/telemetry.md` line 125. - -**Findings** - -1. [NON-BLOCKING] *Security areas touched* is missing an area. The plan lists only "Failure messages and remote text". But it changes which exception warning 2101 logs: the new "not a JSON object" refusal, plus the decoding error now raised for fields the service doesn't read. It also edits `docs/areas/telemetry.md` *Credentials and external data*, the area document of "Logging and telemetry of external data" (`.squad/project.md`, *Security areas*). Smallest fix: add that area to the line, for example `Security areas touched: Failure messages and remote text (…); Logging and telemetry of external data (the exception warning 2101 logs for the .NET release index; no log call changes)`. Recommendation: fix now - -## Security review - -- Finding 1 (non-blocking, *Security areas touched* lacks "Logging and telemetry of external data"): accepted. The - area now stands on the *Security areas touched* line with the wording Security proposed. The orchestrator wrote it - and I confirm it unchanged: the change alters which exception warning 2101 logs and edits - `docs/areas/telemetry.md`, the area document of that security area. No log call, message parameter or other part of - the plan changes. Security measured the claim that the decoding error carries no remote text, so it stays in - *Security considerations* as fact.