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_TOKENwrite 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.ymlworkflow against untrusted PR code with elevated permissions and accessible secrets - Why exploitation is possible:
- The workflow grants nearly all write permissions to the
GITHUB_TOKENor 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_TOKENto 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_targetand 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/*.ymlfor patterns such as: - Broad
permissions: write-allor defaults that grant write access where not needed - Use of privileged secrets in jobs triggered by untrusted events (e.g.,
pull_requestfrom 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

