Research/loom-oauth-flag-follow
0-dayNo CVEMediumPublic

Loom unmigrated OAuth secret follows an MCP endpoint move

Same-group mcp:write can move endpoint_url and the stored OAuth client secret is cleared only when has_oauth2_secret is the string true. An unmigrated row (flag NULL, legacy column set) keeps the secret, and test-connection sends a bearer to the new host. A migrated row clears. Not cross-group. The outbound guard still blocks loopback, metadata, and 0.0.0.0/8. Container SUCCESS on v1.9.0. The same functions are in v1.10.3 and were not re-run in a container on that tag.

Name
Loom unmigrated OAuth secret follows an MCP endpoint move
Type
0-day analysis
CVE
n/a
CVE Risk
medium
Disclosure Status
public
Vendor
Loom
Affected
Loom for AWS v1.9.0 (a3050669f5b4c83210a44ed4346f17e01641e82f), container lab, and the same clear and resolver on v1.10.3 (cc10ab08573087fa12154f7c8181ffcd985fea88), source compare only. Rows whose has_oauth2_secret column is NULL or any value other than the string true, with the legacy oauth2_client_secret column still set. Caller holds mcp:write on that row's group. a2a:write has the same predicate and was not a separate container run.
Published
16 Nov 2026
Updated
16 Nov 2026
Tags
0-day, loom, aws, cwe, cwe-522, oauth

The flag and the secret are not the same column

The migration added a flag so a moved MCP server would drop its saved login, and then the clear looked at the flag instead of the login.

A person who can edit MCP servers in their own group can change an old server's address, and the saved login is still used at the new address. That only happens when the row was never migrated: the flag column is empty, not the word true, and the old plaintext secret column is still filled in. A server created on the current screen drops the login on the same kind of move. This is not another group's server, and it is not loopback or the cloud metadata address. The listener in the lab was a host the outbound check already allows.

Lab files and the client are abraxas/loom-oauth-flag-follow and loom-oauth-flag-follow-Abraxas-Labs.py. I am @abraxas_null. Upstream is awslabs/loom.

The container that printed the oracle was tag v1.9.0, commit a3050669f5b4c83210a44ed4346f17e01641e82f, on 127.0.0.1:18790, with the capture host on 127.0.0.1:18791. I read the same functions on tag v1.10.3, commit cc10ab08573087fa12154f7c8181ffcd985fea88. The clear is still gated on has_oauth2_secret == "true". The resolver still returns the legacy column when Secrets Manager fails. I did not start that container again on v1.10.3. The oracle is the v1.9.0 run, cited against the current files.

No CVE filed here. CWE-522. 6.6 Medium (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:L/A:N). High complexity is deliberate. Only unmigrated rows are affected: the flag is NULL, or any value other than the string true. A deployment that already ran the migration, or that only has rows created after the flag existed, takes the control path and clears. Privileges are high because the caller needs mcp:write. Scope changes because the minted bearer leaves for a different host. Confidentiality of that token is high. Integrity is low. Availability is none. This is not the admin API key bug, and it is not a cross-group read.

Where the clear looks

v1.9.0 was supposed to stop a stored OAuth client secret from following an endpoint change. mcp:write is enough to repoint a server in your own group. The next test or tools refresh would otherwise mint a token and send it to whatever host the URL names now. The comment above the clear says that. The condition does not.

In mcp.py a new oauth2_client_secret on the request is stored, the flag is set to true, and the plaintext column is nulled. The clear is the other branch, at line 422:

Python
elif moved_endpoint and server.has_oauth2_secret == "true":
    delete_secret(...)
    server.oauth2_client_secret = None
    server.has_oauth2_secret = "false"

The flag test is equality with the four characters true. NULL fails it. The string false fails it. The PUT still returns 200, and the plaintext column is left alone.

resolve_oauth2_client_secret at line 67 of backend/app/services/mcp.py never reads the flag. It tries Secrets Manager. On any failure it returns the legacy column if that column is set. The docstring says the plaintext copy stops existing the first time it is used. The function does not set has_oauth2_secret and does not NULL the column. scripts/migrate_oauth2_secrets.py is the path that does both, and request handling never calls it. An upgraded row can keep flag NULL and a live column across uses.

McpServer.to_dict reports has_oauth2_secret as true when the flag column equals true or when the plaintext column is simply non-empty. A screen can say the secret is present while the clear predicate is false. The lab read the raw column, not that boolean.

A2A is the same shape, not a second lab. a2a.py line 316 clears when base_url changed and the flag equals true. The resolver is shared. I ran mcp:write. I did not also drive an A2A card refresh in that container.

The listener did not receive the client secret itself. Test-connection exchanges the stored secret and sends Authorization: Bearer. The lab token was the witness string. The raw column stays in the database.

In plain words, the move is a settings edit. On an old row it changes where the login is sent, and it does not change that the login is sent.

The row I almost called fixed

CVE-2026-103956, CVE-2026-103957, and CVE-2026-103958 are already fixed: unauthenticated super-admin, OAuth token disclosure, and MCP/A2A request forgery. A request with no token got 401 on /api/auth/me. This leftover needs mcp:write. The lab user was in g-admins-demo.

The admin API key sits in the same PUT. It is not this bug. That path clears when its own flag is true, and the read checks the flag before it returns the key. The OAuth resolver never reads its flag.

I pointed the new URL at loopback, the metadata address, and 0.0.0.0/8. guarded_post still refuses those. It allows a private VPC address, and it still blocks loopback, link-local, metadata, and the rest of 0.0.0.0/8. The oracle host was one the guard accepts. Not a guard bypass.

Creating a row through the API sets the flag to true and clears the column. Moving that row ends with flag false and an empty Authorization on the control host. If I had only tested current rows, I would have called the clear finished. The bug is the unfinished migration: flag None, column set, PUT 200, flag still None.

A second worker can keep a cached secret for a few minutes after a successful clear. I did not lab that. The score stays on the unmigrated flag. v1.10.1 closed planting managed keys such as AGENT_CONFIG_JSON. That plant is shut. Bedrock Guardrails are a different feature. I am not mixing either in.

What an attacker can do

Same group only. The lab caller holds mcp:write.

Method Class of impact Lab-proven or inferred
PUT /api/mcp/servers/{id} with a new endpoint_url and no new secret, flag NULL, legacy column set The move succeeds and the secret stays. Integrity of which host the login is for. Lab-proven. HTTP 200, flag still None, column still set.
POST /api/mcp/servers/{id}/test-connection on that row Confidentiality: the new host receives Authorization: Bearer minted from the stored secret. Lab-proven. Bearer contained the witness. Host was one the guard allows.
Same PUT on a row whose flag is true and whose column was cleared at create No follow. Flag becomes false. Lab-proven control. Control host Authorization empty.
PUT of base_url on an A2A row under a2a:write, same flag test at line 316 Same class, if that row is unmigrated. Inferred. Not a separate container run.
endpoint_url aimed at loopback, metadata, or 0.0.0.0/8 No connection. The guard still blocks them. Oracle host was allowed.
A second process still holding a cached secret after a flag-true clear Possible stale mint for minutes. Not labbed. Not in the score.

The client secret string was not what the oracle recorded on the wire. The bearer was. Cross-group was not a result.

What stays closed

Surface Why it is not this bug Lab-proven or inferred
CVE-2026-103956 Unauthenticated super-admin. Lab /api/auth/me with no token is 401. Lab-proven 401. Not re-filed.
CVE-2026-103957 OAuth discovery and token disclosure, fixed in v1.7.0. Not re-filed.
CVE-2026-103958 MCP and A2A SSRF, fixed in v1.7.0. Not re-filed.
Admin API key on the same move Cleared on its flag, and the read path checks the flag. Not this oracle.
Cross-group row This PUT is the caller's own server. Not this lab.
Loopback, metadata, 0.0.0.0/8 guarded_post still blocks them. Holds on this pin.
Migrated row, flag true Move clears the secret. No bearer. Lab-proven control.
Managed AGENT_CONFIG_JSON plant Closed in v1.10.1. Not this bug.
Bedrock Guardrails Unrelated to the OAuth flag. Not mixed in.

The lab

Product routers were the ones in the image. Ports were loopback 127.0.0.1:18790 for Loom and 127.0.0.1:18791 for the capture. I have not re-run it as a container on v1.10.3.

Plain text
LOOM_URL=http://127.0.0.1:18790 ORACLE_URL=http://127.0.0.1:18791 python loom-oauth-flag-follow-Abraxas-Labs.py
Plain text
SUCCESS LOOM-190-OAUTH-FLAG-FOLLOW unmigrated-follow=yes migrated-cleared=yes LOOM-190-OAUTH-FLAG-FOLLOW-WITNESS

Unmigrated: flag None, column set, move returns 200, flag stays None, test-connection sends Bearer and the witness. Migrated control: flag true, column cleared at create, after the move the flag is false and the control host's Authorization is empty. Both halves are the success line. A run that only showed the follow would have over-claimed a bug that current rows do not have.

The fix

Clear on move whenever a secret would still resolve, not only when the flag column is the string true. If the URL changed and the caller did not supply a replacement, delete the Secrets Manager value, NULL the legacy column, and set the flag to false, including when the flag was NULL. Make the resolver do what its docstring already claims, or run migrate_oauth2_secrets.py on upgrade so no NULL-flag row with a plaintext column remains. The response boolean should be the flag, not "flag or leftover column."

A2A needs the same condition. Rows created after the flag exists are already on the control path. The patch is for the rows the flag forgot.

I am @abraxas_null. Lab files: abraxas/loom-oauth-flag-follow. Loom at cc10ab08573087fa12154f7c8181ffcd985fea88: mcp.py line 422, services/mcp.py line 67, a2a.py line 316.