Summary
Gitea fails to apply its migration HTTP transport for LFS push and mirror sync operations, leaving those Large File Storage requests outside the configured protection path.
Under certain configurations, this gap can allow LFS traffic to bypass intended access controls or policy checks, significantly increasing the risk of unauthorized data transfer or repository abuse.
Affected context
This weakness appears in Gitea deployments using versions prior to 1.25.5 that rely on migration HTTP transport settings to enforce security or policy controls on repository migration traffic.
It specifically affects scenarios where:
- Gitea is configured with a hardened or custom migration transport
- Large File Storage (LFS) is used for push operations
- Mirror synchronization depends on the same transport protections
In such environments, LFS push and mirror sync requests do not inherit the configured migration transport behavior, causing a discrepancy between expected and actual protection coverage.
Exploit preconditions
- Attack surface: Gitea instances exposed over HTTP/HTTPS that support LFS and repository mirroring.
- Required access: Ability to initiate LFS push operations or configure/trigger mirror synchronization (often via valid repository or user accounts, depending on instance configuration).
- Trigger point: Performing LFS-related operations (e.g., pushing LFS objects or syncing mirrors) while the instance relies on migration transport for access control or policy enforcement.
- Why exploitation is possible: The code path handling LFS push and mirror sync does not reuse the migration HTTP transport, so those requests bypass any protections, filters, or restrictions configured on the migration transport.
Why this happens
The underlying issue is an authorization and policy enforcement gap caused by inconsistent use of security mechanisms across related code paths.
Gitea's migration functionality supports a dedicated HTTP transport that can enforce protections such as authentication, proxying, or policy checks.
However, LFS push and mirror synchronization logic is implemented using a different or default transport, instead of the hardened migration transport.
This design mismatch aligns with CWE-284: Improper Access Control, where some operations do not receive the same protection level as others, creating a path for bypassing intended access restrictions or security policies.
Potential impact
- LFS traffic can bypass configured migration transport protections, potentially weakening authentication or authorization checks.
- Attackers or malicious users may exfiltrate or inject large binary artifacts outside intended policy controls.
- Mirror synchronization could interact with remote endpoints in ways not subject to the same security scrutiny or restrictions.
- Organizations may experience policy violations, data exposure, or regulatory non-compliance due to inconsistent enforcement of migration-related safeguards.
General mitigation guidance
Mitigation focuses on ensuring that all migration-related operations share a consistent, well-defined access control path.
Common defensive patterns include:
- Centralizing HTTP transport configuration so that LFS push, cloning, and mirror sync all reuse the same hardened transport.
- Treating LFS endpoints as first-class, protected resources with the same authorization and policy enforcement as primary Git operations.
- Applying defense-in-depth controls such as network segmentation, strict outbound connectivity policies, and repository-level permissions to reduce reliance on a single transport mechanism.
- Designing configuration such that deviations from the expected transport (for example, use of a default or fallback transport) are not possible without explicit administrative changes.
How teams detect issues like this
Detection efforts can focus on identifying inconsistent enforcement paths and monitoring LFS-specific behavior:
- Static analysis or code review to verify that LFS push and mirror sync functions use the same HTTP transport and authorization hooks as migration operations.
- Configuration and policy audits to confirm that migration transport settings apply uniformly across all relevant features, including LFS and mirroring.
- Logging and monitoring that differentiates between requests passing through the migration transport and those using alternate transports, with alerts on unexpected paths.
- Use of automated security testing tools to simulate LFS operations and confirm that they are subject to the same access control and policy checks as standard migration workflows.

