Skip to content

fix: harden dashboard profile and artifact boundaries - #69

Merged
TKCen merged 1 commit into
mainfrom
fix/dashboard-artifact-profile-boundaries
Jul 19, 2026
Merged

fix: harden dashboard profile and artifact boundaries#69
TKCen merged 1 commit into
mainfrom
fix/dashboard-artifact-profile-boundaries

Conversation

@TKCen

@TKCen TKCen commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • validate default Sensorium instance names before dashboard root resolution
  • remove deployment-specific artifact trust roots in favor of the active home and system temp directory
  • bound artifact header inspection while preserving the read-only verification contract
  • add regressions for unsafe defaults, dotted valid profiles, portable trust roots, and oversized headers

Verification

  • python -m pytest tests/test_profiles.py tests/test_dashboard_snapshot.py tests/test_triage_api.py -q
  • python -m pytest tests -q
  • python -m py_compile agent_sensorium/*.py scripts/*.py
  • git diff --check

Supersedes the still-relevant dashboard boundary findings from stale security and broad proposal branches without adopting their conflicting changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 69733836dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread dashboard/plugin_api.py
Comment on lines 662 to +663
with open(resolved_path, "r", encoding="utf-8", errors="ignore") as f:
line1 = f.readline()
line2 = f.readline()

prefix = f.read(ARTIFACT_HEADER_PREFIX_BYTES)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Read the bounded artifact prefix in binary mode

When an allowed artifact contains many invalid UTF-8 bytes, TextIOWrapper.read(8192) with errors="ignore" keeps consuming input until it produces 8192 decoded characters or reaches EOF, so this can still read an arbitrarily large file and block every snapshot that verifies it. For example, reading a 2 MiB file of 0xff this way consumes all 2 MiB while returning an empty string; read 8192 bytes from a binary stream first and then decode that fixed prefix.

Useful? React with 👍 / 👎.

Comment thread dashboard/plugin_api.py
line2 = f.readline()

prefix = f.read(ARTIFACT_HEADER_PREFIX_BYTES)
lines = prefix.splitlines()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict artifact header splitting to real newlines

When a corrupt or hostile artifact places a vertical tab, form feed, NEL, or Unicode line separator between the markers, str.splitlines() treats that character as a line boundary and reports VERIFIED_COMPLIANT, even though the required STATUS: and ARTIFACT: markers are on one physical line. The previous readline() implementation rejected these inputs, so split the bounded prefix only on the newline forms accepted by the file format.

Useful? React with 👍 / 👎.

@TKCen
TKCen merged commit af4314a into main Jul 19, 2026
4 checks passed
@TKCen
TKCen deleted the fix/dashboard-artifact-profile-boundaries branch July 19, 2026 21:22
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