Skip to content

CodeQL alert 1: BindText's enum arm dispatches to every ToString override #78

Closed

Description

@CaffeinatedCoder

CodeQL code-scanning alert #1 (cs/information-exposure-through-exception, error) flags tools/probe/corpus/harness/HttpHost.cs:297: the body Hx.Send sends would depend on exception information (JsonException.Path, read by Sides.Answer.Stage in Sides.cs:41).

It is a false positive. The SARIF's code flow runs JsonException.Path → Sides.Answer.Stage → Sides.Answer.ToString() → Hx.BindText → the binding probe's form body → Hx.Send. The step from Answer.ToString() into BindText is the arm "enum" or "flags-enum" => plain.ToString()!, where plain is typed object: CodeQL resolves the virtual call to every ToString override in the database, Answer's among them. At run time plain there is always a boxed enum, and the request goes to the harness's own in-process TestServer. Nothing in the harness ships.

Fix: cast to Enum in that arm (((Enum)plain).ToString()), which narrows the call to Enum.ToString() with the same text, and so removes the flow without a suppression or a dismissal. The alert closes when main is next analysed after the release merges.

Activity

  1. added this to the 2.3.0 milestone on Oct 28, 2026
  2. added
    choreBuild, CI, tooling, packaging, refactoring with no behaviour change
    area/toolingThe repository's tools: prober, verdict, guard, docs-query, smoke test
    on Oct 28, 2026
  3. CaffeinatedCoder commented on Oct 28, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Fixed by #80 (merged into release/2.3.0 as a3f6843), which replaced #79. Code-scanning alert 1 closes when main is analysed after 2.3.0 merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/toolingThe repository's tools: prober, verdict, guard, docs-query, smoke testchoreBuild, CI, tooling, packaging, refactoring with no behaviour change

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions