Skip to content

Bug: governance policy editors replace failed reads with editable security defaults #3839

Closed

Description

@yannickmonney

Finding

Governance policy editors replace failed reads with editable defaults

Impact

If a governance policy read fails after loading (for example HTTP 503), the Settings editor presents built-in defaults as if they were the organization’s saved policy. The controls remain live and editable with no warning or Retry action. An administrator can unknowingly save the defaults over an existing stricter policy, weakening security controls such as password length/character requirements, login controls, session timeout, retention, or data handling settings.

Reproduction

  1. Open Settings → Governance → Password policy for an organization with a saved non-default policy (for example minLength: 24, rotation enabled).
  2. Let governance/queries:getPolicy settle with a server/transport failure after loading ends.
  3. Inspect the editor.

Actual result: the editor renders five live switches and a min-length field set to 12 (DEFAULT_PASSWORD_POLICY), with no read-failure message and no Retry/Try again/Reload action. The form remains registered/editable, so saving can overwrite the unknown saved policy with defaults.

Expected result: distinguish failed reads from a successful absent/default policy. Show a read-error state with Retry and prevent save/toggle writes until a real policy response is available; preserve any previously loaded values during background refetch.

Root cause and scope

At current origin 9ea59724df24d62729a9360f3902d964dab39b3e:

  • services/platform/app/features/settings/governance/components/password-policy-editor.tsx:45-75 destructures only data and isLoading from useGovernancePolicy; parseConfig(policy?.config) returns DEFAULT_PASSWORD_POLICY for undefined and data becomes a loaded form when isLoading is false.
  • The render at :156-211 keeps the switches and inputs enabled; no isError, error, or refetch branch exists.
  • The same useGovernancePolicy/parseConfig(policy?.config) pattern appears in the current policy editors for session idle timeout, login, retention, upload, data notice, DSAR, personalization, routing, moderation, model access, PII, two-factor, voice output, and system prompt settings. This report is grouped around the shared failure mode; Password policy is the reproduced representative because it changes security posture directly.

Evidence

  • Probe: /Users/yannick/.codex/notes/tale-1000-additional/settings-next/governance-policy-read-error.probe.test.tsx
  • Replay: /Users/yannick/.codex/notes/tale-1000-additional/settings-next/governance-policy-read-error.replay.log
  • Probe assertion: one Vitest test passed with data: undefined, isLoading:false, isError:true; PasswordPolicyEditor rendered defaults (five switches and spinbutton value 12) with no alert/retry affordance.

Activity

  1. yannickmonney commented on Oct 5, 2026

    @yannickmonney
    ContributorAuthor

    ACCEPT carried.

    • Source ACCEPT exists at dc7c9fa3018c312e9486409b6d9d26951e9b2411.
    • Author delta is only 0edf8ba7e523315d7888b7863a497ec2fde8b419 (fix(platform): complete governance skeleton browser query mock), touching the expected Browser test file; fix(platform) is an allowed commitlint type/scope.
    • New head 824d030d208d333ef908089f7344429fd51a1209 is a merge of main f04fe7c73fb8da0f3a31f771751a9b880460e545; file composition is the author fix plus main content.
    • Exact-head checks were read once: all completed, no failures; Trivy is neutral and skipped gates are completed.

    Delegated merge is proceeding with --match-head-commit.

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

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions