/

CVE-2026-31852

Severity:

CRITICAL RISK

(10.0)

Improper Authorization / Permission Misconfiguration in

CVE-2026-31852

Analyzed

Vulnerability type

Category:

Improper Authorization / Permission Misconfiguration in CI/CD

CWE:

CWE-269

Impact:

Repository Takeover and CI/CD Supply Chain Compromise

Severity:

CRITICAL RISK

(10.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A misconfigured GitHub Actions workflow in the jellyfin/jellyfin-ios repository allows arbitrary code execution when processing pull requests from forks, while running with highly elevated write permissions.

Under these conditions, an attacker can potentially take over the repository, exfiltrate sensitive secrets, poison release artifacts, and pivot to compromise other Jellyfin organization assets.

Affected context

This vulnerability occurs in the code-quality.yml GitHub Actions workflow of the jellyfin/jellyfin-ios project.

It affects environments where:

  • Pull requests from forked repositories trigger CI workflows
  • The workflow runs with broad GITHUB_TOKEN write permissions or additional privileged tokens
  • Untrusted pull request code is executed before permission or context is safely reduced
  • Secrets and cross-repository tokens are accessible to the workflow job

The issue is limited to the GitHub Actions configuration and does not require changes to end-user installations of the iOS application.

Exploit preconditions

  • Attack surface: GitHub Actions workflow handling pull requests in the jellyfin/jellyfin-ios repository
  • Required access: Ability to open a pull request from a forked repository (no special privileges beyond normal GitHub forking/PR capabilities)
  • Trigger point: Execution of the code-quality.yml workflow against untrusted PR code with elevated permissions and accessible secrets
  • Why exploitation is possible:
  • The workflow grants nearly all write permissions to the GITHUB_TOKEN or other tokens
  • Untrusted code from forks is executed in a context that can write to the repository, modify workflow files, or interact with other organization resources
  • Secrets and cross-repository tokens may be exposed to the workflow, enabling lateral movement across the Jellyfin organization and release pipelines

Why this happens

The root cause lies in improper permission configuration and trust boundaries in CI/CD workflows, mapped to CWE-269: Improper Privilege Management.

The workflow is designed to execute code originating from pull requests, including those from forked repositories, but does so while:

  • Running with excessive write permissions to the repository and possibly to other organization resources
  • Allowing untrusted code to run before reducing permissions or isolating the execution environment
  • Potentially exposing sensitive secrets that were intended only for trusted workflows or protected branches

This combination breaks the expected separation between untrusted contributor code and privileged automation, turning a routine quality check into a powerful attack vector across the source repository and associated supply chain.

Potential impact

  • Full takeover of the jellyfin/jellyfin-ios repository (e.g., force-pushing changes, modifying default branches, or altering workflow configurations)
  • Exfiltration and misuse of highly privileged secrets used within GitHub Actions
  • Apple App Store supply chain attacks via tampered application builds or submission pipelines
  • GitHub Container Registry (ghcr.io) package poisoning, enabling distribution of malicious container images
  • Cross-repository compromise within the Jellyfin GitHub organization via broadly scoped tokens
  • Persistent backdoors in CI/CD workflows and release processes

General mitigation guidance

Pattern-based mitigation for this class of vulnerability focuses on least privilege, trust boundary isolation, and safe defaults in CI/CD workflows:

  • Limit the GITHUB_TOKEN to the minimum required permissions, and prefer read-only scopes for workflows triggered by untrusted events (e.g., pull_request from forks).
  • Split workflows into separate jobs or files so that untrusted code (e.g., linting/testing PR changes) runs without write access or secrets, while privileged steps are restricted to trusted branches or manual approvals.
  • Use pull_request_target and similar triggers with extreme care, ensuring that untrusted code never executes with elevated privileges or sensitive secrets.
  • Restrict availability of organization-wide or cross-repository tokens to workflows that cannot be influenced by untrusted contributors, and avoid exposing them to jobs triggered by forks.
  • Enforce workflow policies (e.g., requiring reviews/approvals or protected branches) before code can affect release or deployment pipelines.
  • Document CI/CD trust boundaries so that contributors understand which workflows are safe for untrusted input and which are reserved for trusted, protected operations.

How teams detect issues like this

Teams can detect and prevent similar CI/CD misconfigurations using a combination of automated and manual approaches:

  • Static analysis of workflow files: Scan .github/workflows/*.yml for patterns such as:
  • Broad permissions: write-all or defaults that grant write access where not needed
  • Use of privileged secrets in jobs triggered by untrusted events (e.g., pull_request from forks)
  • Jobs that combine untrusted code execution with repository write operations
  • Policy-as-code enforcement: Apply organization-level rules (e.g., GitHub repository rules, third-party policy engines) that:
  • Enforce least-privilege token scopes
  • Block exposure of specific secrets to fork-originated workflows
  • Require approvals for changes to workflow files and release pipelines
  • Targeted code review: Treat workflow changes as security-sensitive:
  • Look for new uses of pull_request_target, deployment-related actions, or custom scripts that run on untrusted input
  • Verify that separate workflows or jobs handle untrusted vs. trusted actions
  • Monitoring and audit logs: Review GitHub Actions audit logs and repository activity for:
  • Suspicious workflow runs from forks
  • Unexpected pushes, tag creations, or release actions initiated by CI jobs

Sources

SourceLink
github.comgithub.com/jellyfin/jellyfin-ios/commit/109217e75f38394b2f6e46e25dfe5a721203d3c8
github.comgithub.com/jellyfin/jellyfin-ios/security/advisories/GHSA-7qhm-2m45-7fmh

Frequently asked

questions

Yes. Any GitHub user who can fork the jellyfin/jellyfin-ios repository and open a pull request can potentially trigger the vulnerable workflow, assuming the misconfiguration remains in place.

Only standard contributor capabilities are required: the attacker needs to create a fork and submit a pull request. No prior write access to the repository or organization is needed because the vulnerability arises from the workflow's elevated permissions.

The safest fix pattern is to redesign the workflow to follow least-privilege principles: run untrusted PR code with read-only permissions and no sensitive secrets, isolate privileged operations to trusted branches or manually approved workflows, and minimize token scopes across all jobs.

Establish CI/CD security guidelines that treat workflow files as security-critical code, require review by someone familiar with GitHub Actions security, enforce policy checks for permissions and secret usage in workflows, and regularly audit workflows to ensure untrusted inputs cannot run with elevated privileges or access sensitive secrets.

Find out what's already
exploitable in your codebase.