Skip to content

Media endpoint has no path sanitization - authenticated arbitrary file read from GitHub repos #396

Closed

Description

@leanworld7-netizen

Summary

The media endpoint (packages/outstatic/src/app/api/media/index.ts) has zero sanitization on mediaPath. In legacy mode, mediaPath is interpolated into https://raw.githubusercontent.com/${mediaPath} and fetched server-side with the user GitHub OAuth token.

Vulnerability

An authenticated user can craft arbitrary paths to read files from any GitHub repository their token has access to, including private repos. For example: /api/outstatic/media/private-org/private-repo/main/secrets.env

This is distinct from GHSA-7jvc-9xq8-frff (REST proxy token leak to non-GitHub origins). That advisory covers the REST proxy. This finding covers the media endpoint allowing arbitrary repo path traversal.

Impact

Authenticated arbitrary file read from GitHub repositories, including private repos the user token can access.

Fix

Validate mediaPath against the configured repo owner/slug. Reject paths containing .. or not matching expected repo.

Activity

  1. avitorio commented on Sep 23, 2026

    @avitorio
    Owner

    AI issue report. This issue has been reported previously, it's not a real vulnerability or it overstates the seriousness or likelihood of it happening.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions