Repository navigation
fix(security): honor dashboard feature-flag overrides in the input sanitizer - #18635
Merged
diegosouzapw merged 4 commits intoNov 4, 2026
Conversation
Take the tip's api-typecheck baseline; the PR's reductions are not attributable to its own files. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 4, 2026
diegosouzapw
merged commit Nov 4, 2026
6c58f67
into
cheaper-inference:release/v3.8.53
13 of 34 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18632.
src/shared/utils/inputSanitizer.tsresolvedINPUT_SANITIZER_ENABLEDandPII_REDACTION_ENABLEDstraight fromprocess.env, so a dashboard Feature Flags override (persisted in the key-value store) never took effect — an operator toggling a security-relevant switch saw no behavior change until the env was edited and the process restarted. The sibling guardrail (promptInjection.ts::getMode) already readsINJECTION_GUARD_MODEthroughgetFeatureFlagOverride()with env fallback; this applies the same pattern to the sanitizer's two registered flags.Details:
getConfig()reads the DB override first for both registered flags (INPUT_SANITIZER_ENABLEDdefault "true",PII_REDACTION_ENABLEDdefault "false" — definitions untouched, per the opt-in Hard Rule for PII flags), then falls back to the env var, then the existing default. Behavior is byte-identical for every deployment with no override stored.INPUT_SANITIZER_MODEis intentionally left env-only: it has no registered feature-flag definition, sosetFeatureFlagOverriderejects it and the dashboard cannot set it (the issue listed it among env reads, but only the two keys above are registered flags).The second commit ratchets
config/quality/api-typecheck-baseline.jsonto the live 246 errors (22 baselined errors no longer exist at this tip; identical to the ratchet commit in #18634). It makes the API Route Typecheck job pass on branches cut from the currentrelease/v3.8.53.Validation:
tests/unit/input-sanitizer-flag-overrides-18632.test.ts(drivessanitizeRequest): before the fix, 3 cases fail — dashboard disable suppresses scanning even withINPUT_SANITIZER_ENABLED=truein env, and dashboard PII-redaction override redacts without any env var; after the fix 3/3 pass, including the regression guard that the env fallback still works with no override stored.npm run typecheck:coreclean;node scripts/check/check-api-typecheck.mjsOK on the ratcheted baseline; Prettier clean; ESLint clean on changed files.upstream/release/v3.8.53tipb2a64106c9with no changes applied:scripts-direct-run-guard.test.ts:scripts/cli/omniroute-sso.mjsstill uses the non-portable`file://${process.argv[1]}`guard (verified by running the test in a detached worktree at the tip: same failure).check-docs-counts-sync.test.ts: 7 STRICT drifts at the tip — provider count 377 vs real 380 (AGENTS.md, llm.txt, agentSkills.ts, skills/omni-auth, skills/omni-providers) and migrations 213 vs real 219 (AGENTS.md, llm.txt).npm auditreports 68 vulnerabilities from the base lockfile (same output on the base branch).b2a64106c9.No base-red issue is currently filed. Per the repository's rule I did not fold an inherited-failure fix into this PR.