Argo CD 3.6.3 (24 November 2026) fixes GHSA-mfgm-4p7x-3ccr: create with upsert replaced repositories without the update check. The fix and an audit for your own APIs.
What changed on 24 November 2026
Argo CD published security releases v3.6.3, v3.5.9 and v3.4.15 on 24 November 2026 with fixes for seven advisories. This guide is about one of them, GHSA-mfgm-4p7x-3ccr, rated high: a repository create request with the upsert option could overwrite an existing repository while the server checked only the create permission. A direct update of the same repository needs update. Anyone who held repositories, create (or write-repositories, create) for a repository URL and project, but not update, could replace that repository's stored configuration.
The bug is small and the lesson is general. Many APIs have a create path that can turn into a replace: PUT on a resource that may already exist, an import in merge mode, an upsert flag on a create endpoint. If the authorization check is keyed to the name of the endpoint rather than to the effect on stored data, the create permission quietly becomes an update permission. The same gap appears when an agent is given a create-only tool that happens to accept an overwrite flag.
The sections below explain the advisory from the published text and the fix commit, show a model of the handler before and after the fix, and give an audit you can run over your own routes.
The vulnerable path, step by step
The advisory describes the create handler for repositories. It runs in this order:
- Check
repositories, createfor the requested repository. - Look up a stored repository with the same URL and project.
- If none exists, create it.
- If one exists and is identical to the request, return it unchanged.
- If one exists, differs, and the request did not set
upsert, reject with InvalidArgument and ask the caller to use upsert. - If one exists, differs, and
upsertis set, write the requested repository over the stored one.
Step 6 is the problem. In the vulnerable versions it called the database update directly, so the only permission ever checked was the create check in step 1. The advisory traces the shortcut to commit 433b317 (pull request 20345, the source hydrator work), which first shipped in v2.14.0. Every version from v2.14.0 up to the patched releases is affected; v2.13.9 and earlier are not.
Two details make the impact worse than "a field changed".
The first is that the write is a replacement, not a merge. The advisory states that any field left out of the request is cleared. A caller who wants to break a repository does not need to know its credentials; sending a request without them removes them. The caller also does not need read access to the existing record.
The second is what a repository record controls. It holds credentials, the proxy and no-proxy settings, TLS and SSH settings, and the insecure flag. The advisory spells out the attack: point the repository at a proxy the attacker controls, set insecure for an HTTPS repository, and Argo CD fetches manifests through that proxy. Applications that track the repository, including ones with automated sync, then deploy whatever the proxy serves to their destination clusters. Setting an unreachable proxy instead breaks manifest generation for every application that uses the repository. For write repositories, which the source hydrator uses to push hydrated manifests, the same request replaces the push credentials.
The precondition is narrower than it sounds but common in practice. The attacker must be authenticated and must hold create without update on the targeted URL and project. The built-in role:readonly does not grant that. Project roles often do, because project-scoped repositories exist precisely so developers can add their own repositories without an administrator.
The fix routes upsert through the update handler
The 3.6 backport is commit 5b88885b40, titled "security fixes for 7 advisories". In server/repository/repository.go the change to CreateRepository is two lines. The direct database call in the upsert branch becomes a call to the server's own update handler:
case q.Upsert:
r.Project = q.Repo.Project
// Go through the update handler so upsert needs the same
// `repositories, update` permission as a direct update.
return s.UpdateRepository(ctx, &repositorypkg.RepoUpdateRequest{Repo: r})CreateWriteRepository gets the same change, calling UpdateWriteRepository. The advisory describes the result: a create request that upserts an existing repository goes through the same checks as a direct update, so the caller needs update on both the existing and the requested repository, or the request is denied and the stored repository is left unchanged.
The shape of this fix is worth copying. It does not add a second, hand-written permission check inside the create handler, which would have to be kept in sync with the update handler forever. It makes the replace branch use the one code path that already owns replacement, including its permission check, validation and audit behaviour. If the update handler gains a rule next year, upserts get it too.
A model you can run against both versions
The companion example upsert_permission_model reproduces the decision as a small function. It is a behavioural model written from the advisory, not Argo CD code, and it reduces RBAC object matching to a set of granted actions. The stored record belongs to a fictional Belgavi's Book Store deployment repository; the request keeps the URL and project, adds an attacker proxy, sets insecure and omits the credentials.
# Author: Sandeep Belgavi. Excerpt from upsert_permission_model/example.py
if not upsert:
return False, 'InvalidArgument', existing, trace + ['stored repository differs; the request must set upsert to replace it']
if version == 'vulnerable':
return True, 'Replaced', replace(requested), trace + ['upsert replaced the stored repository without checking update']
trace.append('upsert routed through the update handler')
if 'update' not in grants:
return False, 'PermissionDenied', existing, trace + ['update permission missing; stored repository left unchanged']
return True, 'Replaced', replace(requested), trace + ['update permission present; replaced']The recorded output has four cases. With only create, the vulnerable model replaces the record, the proxy becomes the attacker's, and the username and password are cleared. The patched model denies the same request with PermissionDenied and leaves the record exactly as stored. With create and update, both versions replace it, which is correct: that caller was always allowed to update. A create of a new URL needs only create in both versions, and an identical create returns Unchanged. The interactive lab on this page lets you change the version, the grants, the request and the stored state and see each decision with its trace.
Upgrade and check what was already changed
The patched versions are v3.6.3, v3.5.9 and v3.4.15. The advisory's workaround until you upgrade is to stop granting repositories, create or write-repositories, create to any role that should not also be able to update those repositories, or to narrow the object pattern of the create grant so it does not match repositories that already exist.
Upgrading closes the path but does not tell you whether it was used. Three checks are worth doing after the upgrade:
- List every RBAC policy line, including project roles, that grants
createon repositories or write repositories withoutupdateon the same object pattern. Those are the subjects who could have used the path. - For each repository, compare the current proxy, no-proxy list,
insecureflag and credential presence with what you expect. A repository whose credentials disappeared or whose proxy points somewhere unfamiliar needs investigation. - Check the API server logs and your audit trail for repository create calls with upsert from those subjects. Then rotate the credentials of any repository whose configuration you cannot account for.
Audit your own create-or-replace routes
The general rule is that authorization must follow the effect on stored data, not the name of the call. A request that can replace an existing object is an update, whatever the route is called, and must require the update permission on the object that exists now.
The second half of the companion example applies that rule to a synthetic route table for the book store's admin API. Each route declares whether it can replace an existing object and which permissions it checks. The audit flags three of six routes: the repository upsert, PUT /stores/{id} with only create, and an import in merge mode that checks only import. PUT /price-lists/{id} passes because it checks both create and update, and plain POST /repositories passes because it rejects existing objects.
Doing this by declaration is a starting point, not proof. The stronger test is behavioural: for every route that writes, run it against an existing object with a subject that holds every permission except update, and assert that the stored object is unchanged. That test would have caught this advisory, because it exercises the branch that matters instead of the branch the route name suggests.
Two related habits close most remaining gaps. Treat partial requests on replace paths as dangerous, because a replace that clears omitted fields lets a caller delete secrets it could never read. And make the create handler delegate to the update handler, as the fix does, rather than duplicating checks that will drift.
Where agents come in
An agent that manages deployment configuration is a caller like any other, but it is more likely to find the odd flag. Tool schemas are often generated from API definitions, so an upsert boolean on a create tool becomes a parameter the model can set. If the agent's credentials hold create and not update, the vulnerable handler would let a confused or manipulated agent replace configuration it was never meant to change.
What stays deterministic here is the permission check in the server. Do not try to solve this in the prompt or by hiding the parameter from the model. Remove upsert from the create tool the agent sees, give the agent a separate update tool that is subject to its own approval rules, and rely on the server to enforce update on any replace. A simple create-only integration does not need an agent at all; a deterministic job that adds repositories from a reviewed list is easier to audit and cannot discover flags.
Limits of this guide
The description of the vulnerable handler, the affected versions and the fix comes from the published advisory and the v3.6 backport commit; the code shown is from that commit. The companion example is a model, and it does not reproduce Argo CD's RBAC matching on project and URL patterns. The same release fixes six other advisories, including a Bitbucket Cloud webhook that sent stored repository credentials to a host taken from the payload and a Helm release name evaluated as a template; read the full release notes before you decide your upgrade order.
Interactive experiment
Create, upsert and update: which permission each request needs. Synthetic browser-local fixtures, adjustable inputs, decision traces and JSON export.