Skip to content

fix(windows): check fixed Shell Link ExtraData sizes - #10361

Merged
morluto merged 4 commits into
morluto:mainfrom
wunianze666-netizen:codex/shell-link-fixed-extra-data
Nov 20, 2026
Merged

morluto merged 4 commits into
morluto:mainfrom
wunianze666-netizen:codex/shell-link-fixed-extra-data

Conversation

@wunianze666-netizen

@wunianze666-netizen wunianze666-netizen commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Require the specified size before decoding a fixed-size Shell Link ExtraData block.

Problem and expected behavior

REA decoded oversized blocks from their prefixes and reported complete coverage. For example, a ConsoleFEDataBlock declared as 14 bytes instead of 12 still yielded a code page, and an oversized EnvironmentVariableDataBlock still supplied a derived target. The format defines exact sizes for both blocks. MS-SHLLINK §2.5.2 · §2.5.4

Change and scope

Use one size check for the six fixed-size ExtraData blocks that REA decodes. A mismatched size yields a partial report with the block signature, declared extent, and SHA-256 of its raw payload. The parser continues at the declared boundary, so later blocks remain available. Variable-size and unknown blocks use their existing raw representations. Related #10350 covers the separate target ID list terminator.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • The Shell Link ExtraData decoder owns the fixed-size checks. A short payload keeps the existing truncation category, and a longer payload reports a malformed structure.
  • The CLI and MCP use the existing raw-block and partial-coverage fields. The parser retains artifact identity, later offsets, and the existing read budgets.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • On frozen main bbe2bcc, both oversized examples returned complete coverage with a typed first block. The candidate returns a raw first block and a malformed_structure issue at byte 76. Both legal controls retain identical normalized reports.
  • All six decoded fixed-size signatures have regression cases covering raw hashes and the next block. The public cases preserve the following unknown block and terminal offsets.
  • Validation used synthetic Windows shortcuts. Shell target resolution and third-party shortcut producers were outside this comparison.

For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

On bdf1ba3387, all 146 focused tests passed, including compiled CLI and stdio MCP. The new regression reproduced an affirmative icon mismatch and a derived target extension when a malformed environment block hid a target. The fix retains uncertainty, preserves a known independent match, and leaves icon-only malformed blocks separate. check:fast, formatting, and integration with the landed #12594 passed.

  • Six targeted parser cases failed on the baseline and passed on the candidate. All 54 Shell Link parser tests passed.
  • The compiled CLI and production MCP SDK each inspected the same four files on both revisions. Checked the named ToolDefinition, JSON Schema 2020-12, report shape, file hashes, offsets and MCP client close.
  • Build, formatting, Git diff checks and normal commit and pre-push checks passed.

Compatibility, safety, and release

  • A malformed decoded block now uses the existing raw representation. The valid controls keep their typed values.
  • Windows x64 and Node 24.22.1 were used for offline inspection.

Author readiness

Human owner: @wunianze666-netizen

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T00:17:05.430621Z bdf1ba3 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no new blocking issues found.

Summary

The PR checks exact sizes before decoding six fixed-size Shell Link ExtraData blocks.

  • Windows shortcut reports keep wrongly sized fixed blocks raw.

Reviews (6) · Last reviewed commit: "Merge commit 'e736d90bdf6990ffe8752c090e..." · Reviewed by Greptile

@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: c03e91c1f3

ℹ️ 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".

@morluto
morluto merged commit 46f6d46 into morluto:main Nov 20, 2026
40 checks passed
@morluto morluto added bug Something isn't working area: runtime Process capture and runtime observation labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants