Before commit 6ae6df7d on May 27, 2021, the first executable statement of Distribution's DeleteManifest handler was an unconditional rejection of every tag-shaped request. The handler refused tag references. The storage.delete.enabled gate at the storage layer was correct because nothing reached past it that the gate did not cover. The 2021 commit removed the rejection, added a tag-delete branch, and routed it through a sibling storage method nobody had thought to gate. The test that shipped in the same commit ran with delete: { enabled: false } and asserted the tag was gone afterward. CVE-2026-41888 was codified by the same diff that introduced it.
CVE-2026-41888: Distribution Added Tag Deletion in 2021. The Storage Gate Was Three Functions Away.
vendor
pattern
cve
proof of concept
The gate is on linkedBlobStore.Delete, not on the driver
The OCI Distribution Spec lets an API client say "remove this manifest" two ways. Either the URL ends in a digest (DELETE /v2/alpine/manifests/sha256:abc...) or the URL ends in a tag (DELETE /v2/alpine/manifests/3.23). The Distribution registry forks on the difference inside the same handler. The two branches land in two different storage methods. CVE-2026-41888 is what the two methods disagree about.
The digest branch flows through linkedBlobStore.Delete in registry/storage/linkedblobstore.go. That method's first statement is the gate operators expect when they set storage.delete.enabled: false:
func (lbs *linkedBlobStore) Delete(ctx context.Context, dgst digest.Digest) error {
if !lbs.deleteEnabled {
return distribution.ErrUnsupported
}
// Ensure the blob is available for deletion
_, err := lbs.blobAccessController.Stat(ctx, dgst)
if err != nil {
return err
}
err = lbs.blobAccessController.Clear(ctx, dgst)
...
}The deleteEnabled field is set at registry construction time, from the EnableDelete functional option that NewApp only appends when the operator's config has storage.delete.enabled: true. If the operator omits the option or sets the flag to false, the field stays at its zero value, and every digest-based delete through this method returns ErrUnsupported before any storage I/O happens.
The tag branch flows through tagStore.Untag in registry/storage/tagstore.go. Pre-patch, the entire body of that method was four executable lines, none of which consulted deleteEnabled:
// Untag removes the tag association
func (ts *tagStore) Untag(ctx context.Context, tag string) error {
tagPath, err := pathFor(manifestTagPathSpec{
name: ts.repository.Named().Name(),
tag: tag,
})
if err != nil {
return err
}
return ts.blobStore.driver.Delete(ctx, tagPath)
}pathFor(manifestTagPathSpec{...}) resolves to <root>/v2/repositories/<name>/_manifests/tags/<tag>/. The call to ts.blobStore.driver.Delete reaches the storage driver directly. Where linkedBlobStore.Delete is the wrapper that holds the deleteEnabled check, driver.Delete is the wrapper's underlying writer with no concept of the configuration flag. The operator's deletion policy is encoded one layer up, on a method this call path never touches.
The handler forks on imh.Tag and walks down two different storage subtrees
registry/handlers/manifests.go is where the routing decision is made. Pre-patch:
func (imh *manifestHandler) DeleteManifest(w http.ResponseWriter, r *http.Request) {
dcontext.GetLogger(imh).Debug("DeleteImageManifest")
if imh.App.isCache {
imh.Errors = append(imh.Errors, errcode.ErrorCodeUnsupported)
return
}
if imh.Tag != "" {
dcontext.GetLogger(imh).Debug("DeleteImageTag")
tagService := imh.Repository.Tags(imh.Context)
if err := tagService.Untag(imh.Context, imh.Tag); err != nil {
switch err.(type) {
case distribution.ErrTagUnknown, driver.PathNotFoundError:
imh.Errors = append(imh.Errors, errcode.ErrorCodeManifestUnknown.WithDetail(err))
default:
imh.Errors = append(imh.Errors, errcode.ErrorCodeUnknown.WithDetail(err))
}
return
}
w.WriteHeader(http.StatusAccepted)
return
}
manifests, err := imh.Repository.Manifests(imh)
...
err = manifests.Delete(imh, imh.Digest)Two branches, written next to each other. The first ends at tagService.Untag. The second ends at manifests.Delete, which dispatches into the manifest store and eventually reaches linkedBlobStore.Delete. The branches read as siblings; their storage paths are not siblings. One of them passes through the wrapper that owns the operator's deletion config. The other goes around it.
A registry started with this config file from the advisory:
version: 0.1
storage:
delete:
enabled: false
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000answers the two delete shapes differently. With a manifest digest, the request stops at the storage gate and returns the registry's standard "unsupported operation" error. With a tag reference, the same handler walks into tagStore.Untag, the tag's index directory is removed from the filesystem driver, and the response is 202 Accepted:
$ curl 'http://localhost:5000/v2/alpine/tags/list'
{"name":"alpine","tags":["3.23"]}
$ curl -X DELETE 'http://localhost:5000/v2/alpine/manifests/3.23'
$ curl 'http://localhost:5000/v2/alpine/tags/list'
{"name":"alpine","tags":null}No authentication is configured in the advisory's reproducer. None is required by the code. The DeleteManifest handler has no caller-identity check beyond the one supplied by the operator's auth layer; the gate that the operator believed was disabling deletion entirely is, for this path, advisory at the storage layer and absent at the handler layer.
The 2021 commit removed the gate that was a rejection
Before May 27, 2021, the handler did not have two branches. It had one, and a rejection. Commit 6ae6df7d ("Add tag delete API," signed off by João Pereira) is where the second branch was added. The diff against the prior DeleteManifest:
-// DeleteManifest removes the manifest with the given digest from the registry.
+// DeleteManifest removes the manifest with the given digest or the tag with the given name from the registry.
func (imh *manifestHandler) DeleteManifest(w http.ResponseWriter, r *http.Request) {
dcontext.GetLogger(imh).Debug("DeleteImageManifest")
- if imh.Tag != "" {
+ if imh.App.isCache {
imh.Errors = append(imh.Errors, errcode.ErrorCodeUnsupported)
return
}
+ if imh.Tag != "" {
+ tagService := imh.Repository.Tags(imh.Context)
+ if err := tagService.Untag(imh.Context, imh.Tag); err != nil {
+ switch err.(type) {
+ case distribution.ErrTagUnknown:
+ case driver.PathNotFoundError:
+ imh.Errors = append(imh.Errors, v2.ErrorCodeManifestUnknown)
+ default:
+ imh.Errors = append(imh.Errors, errcode.ErrorCodeUnknown)
+ }
+ return
+ }
+ w.WriteHeader(http.StatusAccepted)
+ return
+ }The removed block, if imh.Tag != "" { errors = append(errors, ErrorCodeUnsupported); return }, was the entire reason the storage-layer gate worked. It was not labeled as a security check. It was the handler refusing to do something it could not yet do. The deletion gate at linkedBlobStore.Delete was correct in that earlier world because the handler did not accept tag references and so could not reach a non-gated storage method.
The 2021 commit reads as a feature commit. The body of the commit message is one sentence ("Add tag delete API"). The diff touches eight files. None of those files is registry/storage/linkedblobstore.go, the file the operator's config flag was attached to. The new branch wires the tag delete to tagStore.Untag, which exists in the codebase for several years before this and was previously only invoked by the digest-delete handler's tag-cleanup loop (when a manifest was deleted, the handler enumerated tags pointing to it and untagged them). That tag-cleanup loop only ran after manifests.Delete had already succeeded, which meant the loop only ran when deleteEnabled was already true. tagStore.Untag therefore had never been called along a code path that reached it with deleteEnabled false. The 2021 commit introduced the first one.
CVE-2026-41888 is the parallel-implementation-gap shape the catalog has been collecting: a capability implemented twice in the same file, where the gate is wired through one branch and not the other. The closest sibling exhibits are Axios's CVE-2026-42036 (the maxContentLength cap rode inside the buffered branch's chunk counter, and the streaming branch had no counter for it to ride), Next.js's CVE-2026-44577 (the response-size cap was threaded into the external branch of a ternary and not the internal branch), and NocoBase's CVE-2026-41641 (a checkSQL middleware was wired to two of three actions on one object literal). The Distribution case is the across-handler-branches variant of the same shape, plus a temporal precondition: the gate at the storage layer had been the only gate because the handler had been refusing the divergent shape on its own. Removing the handler's refusal made the storage-layer gate's coverage incomplete in the same diff that made the divergence reachable.
The test that shipped with the bug asserted the bug
Five files changed in commit 6ae6df7d. One of them was registry/handlers/api_test.go, which added the test suite for the new tag-delete API. The test setup function it called was newTestEnv(t, deleteEnabled bool):
func newTestEnv(t *testing.T, deleteEnabled bool) *testEnv {
config := configuration.Configuration{
Storage: configuration.Storage{
"inmemory": configuration.Parameters{},
"delete": configuration.Parameters{"enabled": deleteEnabled},
...The second argument flows into the registry config as storage.delete.enabled. The test that the 2021 commit added, TestManifestAPI_DeleteTag, called it like this:
func TestManifestAPI_DeleteTag(t *testing.T) {
env := newTestEnv(t, false)
defer env.Shutdown()
...false. The test that asserted tag delete worked was run against a registry the test had explicitly configured with deletions disabled. It passed for nearly five years. It had to pass; the bug was the only reason it could.
The April 25, 2026 fix diff includes this change to that test file:
func TestManifestAPI_DeleteTag(t *testing.T) {
- env := newTestEnv(t, false)
+ env := newTestEnv(t, true)
defer env.Shutdown()Two characters. The fix had to flip the test from false to true because the test was verifying legitimate tag-delete functionality, and after the patch, legitimate tag-delete functionality requires deletions to be enabled. A new test, TestManifestAPI_DeleteTag_DeleteDisabled, was added alongside it:
func TestManifestAPI_DeleteTag_DeleteDisabled(t *testing.T) {
env := newTestEnv(t, false)
defer env.Shutdown()
...
resp, err := httpDelete(u)
msg := "deleting tag with delete disabled"
checkResponse(t, msg, resp, http.StatusMethodNotAllowed)
checkBodyHasErrorCodes(t, msg, resp, errcode.ErrorCodeUnsupported)
msg = "checking tag exists after rejected delete"
resp, err = http.Get(u)
checkResponse(t, msg, resp, http.StatusOK)
}The new test is the test the 2021 commit should have written. It uses the same newTestEnv(t, false) the original test used, and asserts the opposite outcome. Side by side, the diff makes the inversion explicit: the original test in 2021 sent a DELETE to a registry with deletes disabled and checked the tag was gone; the new test in 2026 sends the same DELETE to a registry with deletes disabled and checks the tag is still there. Both tests run against the same config. The change between them is which behavior the project is willing to commit to in writing.
The test that shipped with the bug-introducing commit was not written wrong. It was written to verify the feature its commit introduced. The feature's behavior was the bug. The test's false is the receipt.
The fix wires deleteEnabled to three places
The April 25, 2026 patch (commit 8baf3e0, "fix: prevent tag deletion when storage.delete.enabled is false," same author as the original commit five years earlier) does not put the gate in one place. It puts it in three.
First, the App struct gains a deleteEnabled field that the handler layer can read without descending into the storage configuration:
type App struct {
...
// readOnly is true if the registry is in a read-only maintenance mode
readOnly bool
+
+ // deleteEnabled is true if the registry is configured to enable deletions.
+ deleteEnabled bool
}NewApp sets it in the same conditional that installs the EnableDelete storage option. Second, DeleteManifest consults the new field at the top of the handler, before either branch of the imh.Tag fork is reached:
+ if !imh.App.deleteEnabled {
+ imh.Errors = append(imh.Errors, errcode.ErrorCodeUnsupported)
+ return
+ }
+
if imh.Tag != "" {
dcontext.GetLogger(imh).Debug("DeleteImageTag")
tagService := imh.Repository.Tags(imh.Context)The fix at this layer alone would close CVE-2026-41888. The handler refuses every delete the operator disabled, before the fork happens. Third, tagStore itself gets the flag wired in, and Untag rejects the operation at the storage layer too:
type tagStore struct {
repository *repository
blobStore *blobStore
concurrencyLimit int
+ deleteEnabled bool
} // Untag removes the tag association
func (ts *tagStore) Untag(ctx context.Context, tag string) error {
+ if !ts.deleteEnabled {
+ return distribution.ErrUnsupported
+ }
tagPath, err := pathFor(manifestTagPathSpec{The handler-layer fix is sufficient. The storage-layer fix is what tells you the author had counted the callers. tagStore.Untag is reachable from proxyTagService.Untag (pull-through proxy mode delegates to a local tag store) and from the manifest-delete handler's tag-cleanup goroutines, which untag every tag pointing to a digest after the digest's manifest has been deleted. The fix at three layers exists because at least one of those other callers might, in some future commit, be reachable from a route the handler-layer check does not cover. The patch author wrote the gate three times because the bug existed in the first place by being written zero times where it was needed.
Distribution v2 was never patched
The advisory lists two affected packages. github.com/distribution/distribution/v3 is fixed in 3.1.1. github.com/distribution/distribution, the v2 line that ships as the Docker registry:2 image, is listed as vulnerable in <= 2.8.3 with first_patched_version: null. There is no v2 fix. Operators running registry:2 who configured storage.delete.enabled: false because they wanted their registry immutable are running an unpatched registry against a CVE-2026-41888 reproducer that ships in the GitHub advisory. The route forward for those operators is to upgrade to v3, which has been GA since April 2025 but is a major version bump with configuration migration. The bug class lives in both lines, the fix lives in one.
What storage.delete.enabled: false meant, against what it did
An operator setting storage.delete.enabled: false was making a registry-level statement about destructive operations. The flag's documentation describes deletion of manifests and blobs at the API surface. The implementation placed enforcement at the storage layer's blob-and-manifest wrapper. When tag deletion was added in 2021, the operator's intent (no destructive API on this registry) and the implementation's enforcement model (gate the storage method the digest-delete path happens to flow through) drifted apart. Tag deletion is destructive at the API surface. It is not destructive at the blob layer (the underlying manifest data stays on disk until garbage collection runs, if it ever does). The gate sat where the blob layer was, and the new API didn't reach the blob layer.
This is the gap operators routinely fall into when a vendor's config option names a verb (delete) and the implementation places the gate at a noun (blob storage). The verb has at least two referents in the OCI Distribution Spec. The noun has one.
The 2021 commit replaced one rejection with one acceptance. The 2026 patch restores the rejection in three places, in case the next tag-shaped feature does not look up.