Skip to content

validation(schemas): reject control characters in persisted names - #1089

Draft
seonghobae wants to merge 5 commits into
mainfrom
sentinel/fix-schema-validation-12686361770666554883
Draft

validation(schemas): reject control characters in persisted names#1089
seonghobae wants to merge 5 commits into
mainfrom
sentinel/fix-schema-validation-12686361770666554883

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Current boundary

This is an input-contract hardening change for persisted/user-visible names. It is not classified as a demonstrated MEDIUM vulnerability: this branch does not establish a concrete downstream log-injection, null-byte exploit, terminal-escape execution path, or severity score.

  • protected/base: main@8dc746920c12988f082e914879d95e13c9693535
  • exact head: 2eb1608316a5c0532ce460927ca6e99b6a432611
  • lifecycle: open / Draft
  • effective protected-base files: backend/app/schemas.py, backend/tests/test_schema_validation.py
  • generated .jules/sentinel.md appendix has been restored byte-for-byte to protected authority

Contract

DiagramViewCreateIn.name and ApiKeyCreateIn.key_name already had non-empty and maximum-length bounds. The candidate additionally rejects C0 controls and DEL (U+0000..U+001F, U+007F) before those values become persisted/displayed names. Ordinary spaces and Unicode names remain admitted.

The deterministic schema regression covers NUL, tab, LF, CR, ESC and DEL for both fields and a positive Korean/Japanese/space-bearing control. This keeps the repair at the Pydantic admission boundary rather than inferring safety from a later renderer or logger.

Acceptance

Run the repository-native schema/backend suites and all applicable exact-head CI/Security/SAST/CodeQL gates on one unchanged SHA. Preserve the existing length contracts and Unicode acceptance. If a product requirement later needs multiline/tab-bearing names, that is a domain-policy decision and should change the field contract explicitly rather than bypass validation downstream.

Do not restore repository-wide Sentinel doctrine, manufacture security severity without an exploit/threat-model basis, suppress scanners, self-approve, force-push, destructively rebase, or transfer predecessor GREEN. Keep Draft until terminal exact-head evidence and qualifying current-head independent review are present.

This commit adds explicit regex validation to the DiagramViewCreateIn
and ApiKeyCreateIn schemas to reject control characters, hardening
these fields against log injection or unexpected terminal escapes.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as draft September 6, 2026 02:20
@seonghobae seonghobae changed the title 🛡️ Sentinel: [MEDIUM] Fix control character validation on schemas validation(schemas): reject control characters in persisted names Sep 6, 2026
This commit adds explicit regex validation to the DiagramViewCreateIn
and ApiKeyCreateIn schemas to reject control characters, hardening
these fields against log injection or unexpected terminal escapes.
This commit adds explicit regex validation to the DiagramViewCreateIn
and ApiKeyCreateIn schemas to reject control characters, hardening
these fields against log injection or unexpected terminal escapes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant