Skip to content

context7: pin sync/update.sh upstream fetch URLs to a commit SHA, not master #963

Closed as not planned

Description

@kyle-sexton

Context

PR #961's security review flagged that plugins/dometrain/skills/sync/scripts/update.sh fetched
its upstream drift-check content from an unpinned master branch — a supply-chain integrity gap:
a compromise of the upstream account (repo takeover, malicious merged PR, compromised PAT) would
silently replace the fetched content with attacker-controlled prose, which a maintainer's diff
review is not a fully reliable defense against for subtle semantic injection.

Fixed for dometrain in #961 by pinning UPSTREAM_URL to a specific commit SHA (bumped
deliberately by a maintainer as an explicit "I intend to review this commit" act, documented in
plugins/dometrain/skills/sync/context/update.md).

plugins/context7/skills/lookup/scripts/update.sh has the identical pattern — both
UPSTREAM_FIND_DOCS and UPSTREAM_CLI_SKILL fetch from
https://raw.githubusercontent.com/upstash/context7/refs/heads/master/... (unpinned branch, not
a commit SHA).

Proposed work

  • Pin both UPSTREAM_FIND_DOCS and UPSTREAM_CLI_SKILL in
    plugins/context7/skills/lookup/scripts/update.sh to specific commit SHAs.
  • Document the bump-then-refresh protocol in plugins/context7/skills/lookup/context/update.md,
    mirroring plugins/dometrain/skills/sync/context/update.md's new section.

Acceptance criteria

  • Both upstream URLs in context7's update.sh are pinned to commit SHAs, not master.
  • context/update.md documents the pin-bump protocol.
  • bash plugins/context7/skills/lookup/scripts/update.sh still reports no drift immediately
    after the pin bump (baseline matches the newly pinned commit).

References

  • plugins/dometrain/skills/sync/scripts/update.sh — the fix pattern (pinned SHA + comment).
  • plugins/dometrain/skills/sync/context/update.md — the bump-then-refresh protocol to mirror.
  • PR feat(dometrain): add Dometrain course-content grounding plugin #961's security-review bot comment (SUGGESTION finding) — original source of this finding.

Activity

  1. added
    area: security
    on Jul 22, 2026
  2. added theissue type on Jul 22, 2026
  3. kyle-sexton commented on Jul 22, 2026

    @kyle-sexton
    MemberAuthor

    Closing not-planned: an independent second reviewer (Codex) caught that pinning the fetch URL to a fixed commit breaks the drift-check's actual purpose — a pinned URL means check compares against the same frozen commit forever, so it can never detect real upstream drift once the source moves. Applying this to dometrain (PR #961) was reverted for the same reason before merge.

    The maintainer's diff review before choosing to run --refresh-baseline is already the meaningful integrity gate the original security-review finding was after; a URL pin adds ceremony without adding protection beyond that, while actively breaking detection. Not porting this to context7 either — its existing unpinned-master fetch is correct as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: security

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions