Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-94620 Overview
CVE-2026-94620 is a symlink-based arbitrary file write vulnerability in Classroom 50, an open-source tool for managing and grading programming assignments via GitHub. The gh teacher download command clones each student repository and writes autograde artifacts (result.json and results.json) into the working tree without validating symbolic links. A student can commit either file as a symlink, redirecting the teacher's write to any path reachable from the teacher's account. The resulting file write executes code in the teacher's context, whose gh token holds admin:org, repo, and workflow scopes across the entire classroom organization. Version 1.11.0 contains the fix.
Critical Impact
An untrusted student repository can achieve code execution as the teacher and compromise every repository in the classroom GitHub organization.
Affected Products
- Classroom 50 (gh teacher download command) prior to version 1.11.0
- Teacher environments running the gh-teacher CLI against student submissions
- GitHub organizations where the teacher token holds admin:org, repo, and workflow scopes
Discovery Timeline
- 2026-10-01 - CVE-2026-94620 published to NVD
- 2026-10-02 - Last updated in NVD database
Technical Details for CVE-2026-94620
Vulnerability Analysis
The vulnerability is a path traversal via symbolic link following [CWE-22]. During gh teacher download, the tool clones each student assignment repository and then writes two autograde artifacts, result.json and results.json, into the just-cloned working tree. The write operation uses os.WriteFile without checking whether the destination path is a symbolic link.
A student who commits result.json or results.json as a symlink causes git clone to materialize that symlink verbatim on disk. When the teacher's tool then writes to the artifact filename, the kernel follows the link and writes to the symlink's target instead. The file contents are attacker-controlled: the student supplies result.json bytes as a release asset, and results.json is populated from student-chosen submit-tag names.
Root Cause
The download routine trusted the just-cloned working tree as a safe write destination. It called os.WriteFile(filepath.Join(target, resultsAssetName), ...) directly, which transparently follows symlinks. There was no boundary enforcement to confine writes within the clone directory and no pre-write check for pre-existing symlinks, hardlinks, or special files at the artifact paths.
Attack Vector
A student commits a symlink named result.json or results.json pointing to a sensitive file reachable by the teacher's user account. Candidate targets include ~/.zshrc, ~/.ssh/authorized_keys, cron entries, or .git/hooks/post-checkout inside the clone itself. When the teacher runs gh teacher download, the student-controlled bytes are written to that target. Code execution follows when the shell, SSH daemon, cron, or git subsequently reads the overwritten file.
// Patch: cli/gh-teacher/internal/download/download.go
// Source: https://github.com/foundation50/classroom50/commit/79112f33932d1b5c398a8801d97a8813d52d55ce
// target is a student-controlled working tree: a committed result.json /
// results.json symlink (materialized verbatim by git clone) would redirect
// these writes. os.Root confines writes to the clone (refusing symlink
// escape); writeGuarded replaces any pre-existing entry with a fresh regular
// file so an in-clone symlink/hardlink (e.g. to .git/hooks/*, which git would
// then execute) or a blocking FIFO can't be written through. GHSA-qx2g-vpwq-466c.
root, err := os.OpenRoot(target)
if err != nil {
return fmt.Errorf("open clone dir %s: %w", target, err)
}
defer func() { _ = root.Close() }()
if err := writeGuarded(root, resultsAssetName, historyBytes); err != nil {
return err
}
// Back-compat: point <repo>/result.json at the latest submission's payload
for _, rec := range history {
if len(rec.Result) > 0 {
return writeGuarded(root, resultAssetName, rec.Result)
}
}
The patch uses os.OpenRoot to confine writes to the clone directory and writeGuarded to replace any pre-existing entry with a fresh regular file.
Detection Methods for CVE-2026-94620
Indicators of Compromise
- Student repositories containing a committed result.json or results.json entry that is a symlink, hardlink, FIFO, or other non-regular file.
- Unexpected modifications to teacher-side files such as ~/.zshrc, ~/.ssh/authorized_keys, crontab entries, or files under .git/hooks/ inside a cloned student repo.
- Outbound connections or shell processes spawned shortly after gh teacher download runs against a student submission.
Detection Strategies
- Inspect each cloned tree for symbolic links or special files before invoking the artifact-refresh step. A one-line find <clone> -maxdepth 2 \( -type l -o -type p -o -type s \) surfaces offending entries.
- Monitor process ancestry on teacher workstations for gh teacher download followed by writes outside the expected clone directory.
- Audit teacher host file integrity on sensitive paths (~/.ssh/, shell rc files, cron directories) after each grading run.
Monitoring Recommendations
- Enable file-integrity monitoring on authentication, shell, and scheduled-task files in teacher accounts.
- Log and alert on git hook execution occurring during or immediately after a clone operation.
- Capture command-line telemetry for the gh CLI and correlate with filesystem write events outside the clone root.
How to Mitigate CVE-2026-94620
Immediate Actions Required
- Upgrade Classroom 50 to version 1.11.0 or later on every teacher workstation and CI runner that executes gh teacher download.
- Rotate any GitHub tokens, SSH keys, or credentials that were present on hosts running vulnerable versions against untrusted student repositories.
- Review recent clone directories and teacher home directories for signs of the symlink-redirection pattern described above.
Patch Information
The fix is implemented in commit 79112f3 and shipped in Classroom 50 version 1.11.0. The patched download routine uses os.OpenRoot to confine writes to the clone directory and a writeGuarded helper that refuses to write through pre-existing symlinks, hardlinks, or FIFOs. See the GitHub Security Advisory GHSA-qx2g-vpwq-466c and the patch commit for details.
Workarounds
- Avoid running gh teacher download against untrusted student repositories until the upgrade is applied.
- Execute the command inside a disposable sandbox or container with no access to sensitive host files, SSH keys, or developer credentials.
- Inspect cloned trees for symlinked, hardlinked, or special (result.json / results.json) entries before allowing the artifact-refresh step to run.
# Pre-flight check: fail if an unsafe artifact file exists in any clone
find ./classroom-clones -maxdepth 3 \
\( -name 'result.json' -o -name 'results.json' \) \
\( -type l -o -type p -o -type s -o -links +1 \) -print -quit \
| grep -q . && { echo "unsafe artifact detected"; exit 1; }
# Upgrade to the patched release
go install github.com/foundation50/classroom50/cli/gh-teacher@v1.11.0
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

