Skip to content

fix(windows): bound shortcut string offsets to structure data - #10416

Merged
morluto merged 6 commits into
morluto:mainfrom
wunianze666-netizen:codex/shell-link-info-header-offsets
Nov 19, 2026
Merged

morluto merged 6 commits into
morluto:mainfrom
wunianze666-netizen:codex/shell-link-info-header-offsets

Conversation

@wunianze666-netizen

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

Copy link
Copy Markdown
Contributor

Summary

Reject Shell Link string offsets that point into LinkInfo or nested structure headers.

Problem and expected behavior

The LinkInfo offsets for ANSI and Unicode paths identify data following the declared header. If LocalBasePathOffset points to the header-size field, the parser currently reads the header byte as a path and reports complete coverage. The offset must identify the path field within LinkInfo. MS-SHLLINK §2.3

Volume labels and network names also live after their own structure headers. Offsets into those headers previously produced header bytes as labels or names with complete coverage. See VolumeID and CommonNetworkRelativeLink.

Change and scope

Bound string offsets by their LinkInfo, VolumeID, or network header and report an issue at the offending offset field. Keep later structures and readable sibling fields. An unreadable declared target leaves a target extension or mismatch unknown unless another complete independent target matches the icon.

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 parser validates LinkInfo and nested VolumeID/network string offsets before reading their strings; derived target claims preserve uncertainty when a declared path cannot be read.
  • The CLI and MCP use existing malformed_structure and partial coverage fields. The parser retains artifact identity, other fields and the existing 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 cdc4541, the ANSI and Unicode header-offset cases returned complete coverage. The candidate reports partial coverage and leaves the malformed path unset. The valid control retains an equal normalized report.
  • Parser cases cover both encodings and assert the later ExtraData terminal remains available. Compiled CLI and named MCP SDK use the same bytes.
  • Validation used synthetic shortcuts on Windows. Windows 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

  • Review follow-up: complete target candidates retain their own local, network and suffix completeness. An unreadable component cannot turn a bare base or ANSI fallback into a definite match; a separate complete target can still match. Three selected cases failed and three passed on the prior head; all six passed after the fix (72 name-deselected). The parser/service suite passed 85 tests.

  • On the prior head and this revision, the compiled CLI and named MCP SDK each inspected the same seven authored shortcuts (same path, hash and bytes), with input/output schema validation and connection close. Four incomplete candidates changed from a false match to unknown; a valid target and two independent-match controls retained their results. The valid control's normalized output was unchanged.

  • Current nested structure offsets: 6 selected cases failed before the change and passed after (61 name-deselected). All 78 parser/service tests passed, including the existing truncated Unicode-header recovery and controls for target comparison uncertainty.

  • On the prior PR head 11345aa26f7a873c47c61e4474ea8b4bfe670b28, the compiled CLI and named MCP SDK each read the same six malformed synthetic files and two valid controls; the malformed values were control bytes with complete coverage. After the change, both interfaces return partial coverage and null for the affected field; both valid controls retain identical normalized reports. Named schemas and client close were checked. Three additional CLI/MCP cases cover unknown target, known match and valid Unicode fallback. The nested parser was unchanged between the original base and main 5815178a8d581fa81a9422cdfb9f86dd5cb913d7.

  • Review follow-up: both ANSI and Unicode common-path suffix offsets into the LinkInfo header are covered. With their lower-bound checks temporarily removed, the two selected tests failed; after restoring the production checks, both passed (59 tests deselected). The parser and service suite passed 67 tests.

  • Two targeted parser cases failed on the baseline and passed on the candidate. All 65 focused parser and service tests passed.

  • The compiled CLI and production MCP SDK each handled the same three files on both revisions. Checked ToolDefinition, JSON Schema 2020-12, report shape, source hashes, offsets and MCP client close.

  • Build, formatting, Git diff checks and normal commit and pre-push checks passed.

Compatibility, safety, and release

  • An offset into the header now produces the existing partial report. The valid control retains its prior output.
  • 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-19T15:19:39.878074Z 32900aa 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; no blocking code issues were found.

Summary

The shortcut parser rejects string offsets into structure headers and keeps target claims unknown when declared path data cannot be read.

  • Shortcut strings now start after their structure headers.
  • Unreadable shortcut paths no longer create definite target claims.

No new actionable issues found. Both earlier review concerns are addressed. Review was source-based; tests were not rerun.

Reviews (6) · Last reviewed commit: "merge(windows): integrate shortcut offse..." · Reviewed by Greptile

@wunianze666-netizen wunianze666-netizen changed the title fix(windows): reject shortcut paths into LinkInfo headers fix(windows): bound shortcut string offsets to structure data Nov 14, 2026

@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: 5fc4ce4466

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

Keep LinkInfo, VolumeID, and network string offsets inside structure
data while retaining main's ANSI path identity, StringData limits, and
TerminalBlock coverage.
@morluto
morluto merged commit a4a633b into morluto:main Nov 19, 2026
4 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.

3 participants