Skip to content

BadResponse carries the server's Content-Type cut to 60 characters, not redacted first (kube.py:221) #803

Done

Description

@ephico2real2

Part of #26. Found by reviewer 2 on PR #795 (docs/reviews/2026-12-01-issue-763/), pre-existing.

What is wrong. cmapi/src/cmapi/core/clients/kube.py:221 puts the response's Content-Type, cut to 60 characters, into BadResponse without the reader redactor, which breaks the rule "redact the whole text, then cut". The comment at cmapi/src/cmapi/capacity/thanos.py:47 says otherwise.

Why Low. Not exploitable as measured: the text is a response header, and the reader's token is a JWS whose protected header alone is longer than 60 characters (RFC 7515 §3.1; Kubernetes pkg/serviceaccount/jwt.go), so a cut prefix holds no secret. It is filed with security because it touches redaction, so it is fixed in this session.

How to prove it. A test with a fake server whose Content-Type carries a marker string that the redactor removes: today the marker reaches BadResponse; after the fix it does not.

Research mandate. Quote RFC 9110 on the Content-Type field and apply the module's own redactor before the cut.

Activity

  1. added
    bug
    sev:low
    security
    on Dec 1, 2026
  2. added 2 commits that reference this issue on Dec 2, 2026
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

    bugsecuritysev:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions