Skip to content

fix(knowledge): harden video-digest's shallow clones of harvested repositories #6829

Closed

Description

@kyle-sexton

Severity: low (auditor severity, uncalibrated)
Readiness: agent-ready. The environment variables are documented upstream; the prompt and LFS effects themselves were inferred, not reproduced.

Summary

analyze-harvested-repos.js shallow-clones repository URLs taken from video descriptions and comments with stdio: "ignore", the inherited environment and no timeout. A private or renamed repository can trigger a credential prompt or helper, and an LFS-heavy repository downloads its objects.

Failure scenario

  1. A video description links a private GitHub repository.

Expected: the clone fails fast and the harvest continues.

Actual (inferred from git defaults): git may prompt for credentials with no terminal attached, and nothing kills the clone.

Evidence

  • analyze-harvested-repos.js:31-38.
  • GIT_TERMINAL_PROMPT: "If this Boolean environment variable is set to false, git will not prompt on the terminal" (git docs).
  • GIT_LFS_SKIP_SMUDGE: "Sets whether or not Git LFS will skip attempting to convert pointers of files tracked into their corresponding objects" (git-lfs-config).
  • Not reproduced.

Suggested fix (cheapest first)

  1. Pass env: { ...process.env, GIT_TERMINAL_PROMPT: "0", GIT_LFS_SKIP_SMUDGE: "1" } to the clone spawn.
  2. Kill the clone after a timeout and treat it as a failed clone.

Audit reference: plugin-quality audit run 20261010T195441Z, finding I9. Validated against main 28a5541cbb91f5ca0aeb3c361ebafbde4c0c0b41.

🤖 Generated with Claude Code

Activity

  1. added
    needs-triage
    agent-ready
    on Oct 10, 2026
  2. github-actions commented on Oct 10, 2026

    @github-actions
    Contributor

    Thanks for the report. I confirmed the code: shallowCloneGitHubRepo in analyze-harvested-repos.js spawns git clone with stdio: "ignore", the inherited environment, and no timeout, so a private/renamed repo's credential prompt or an LFS-heavy repo's download isn't guarded against. The suggested fix (set GIT_TERMINAL_PROMPT=0 and GIT_LFS_SKIP_SMUDGE=1 in the spawn env, plus a clone timeout) looks like a reasonable, low-risk way to address it. I didn't find any existing open issue covering this same hardening gap. No fix or timeline is implied by this triage.

    Automated triage. A maintainer reviews it.

  3. added
    area: security
    good first issue
    on Oct 10, 2026
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

    agent-readyarea: securitygood first issueneeds-triage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions