Skip to content

fix: validate GIF and WEBP signatures as exact bytes - #703

Merged
testikun merged 4 commits into
openpi-dev:mainfrom
outlier27-cell:fix/image-signature-bytes
Oct 9, 2026
Merged

testikun merged 4 commits into
openpi-dev:mainfrom
outlier27-cell:fix/image-signature-bytes

Conversation

@outlier27-cell

Copy link
Copy Markdown
Contributor

Problem

Fixes #697. ASCII decoding clears high bits, so corrupted GIF and RIFF/WEBP signatures pass Cursor input and Web HTTP image admission.

Value

Reject malformed image signatures before forwarding user input. This does not claim full image decoding or semantic validation.

Approach

Compare signature bytes exactly at both existing boundaries. Add actual Cursor transformation and Web HTTP admission regressions for valid signatures and each high-bit corruption. See docs/research/IMAGE_SIGNATURE_BYTES_2026-10-07.md.

Validation

  • New regressions failed on origin/main, then passed after the fix.
  • bun run check: passed.
  • bun run test: ran, failed locally on Windows (21 failures including renderer assertions, symlink EPERM, replay/session failures and timeouts). The workspace-file-organization child remained alive after its tests and was stopped after 450 seconds; the runner then exited 1. UI tests were not reached. Logs retained outside the checkout; no full local pass is claimed.
  • Exact-head GitHub CI will be checked separately.

Impact

User input: corrupted signatures rejected. Model context: valid images unchanged. Runtime: existing input boundaries only. Persistence/config: none. Compatibility: valid GIF87a/GIF89a/WEBP remain supported; PNG/JPEG unchanged.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 7, 2026
@outlier27-cell

Copy link
Copy Markdown
Contributor Author

@tt-a1i 请审核此 PR。最新提交已通过完整 GitHub CI,当前可合并;如有需要调整的地方,我会在原分支及时修复。

@testikun testikun left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

已复查 Web HTTP 图片入口和对应 HTTP 回归(提交 f1d53a4c6ba0),并核对相关调用点和回归覆盖。本次未发现新增的 P1/P2。本次审查范围为 Web 部分。

@testikun
testikun merged commit 56a7fe0 into openpi-dev:main Oct 9, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(images): compare GIF and WebP signatures without lossy ASCII decoding

2 participants