Summary
A flaw in MinIO's extractMetadataFromMime() handling of replication-related headers allows any authenticated user with s3:PutObject permission to inject internal server-side encryption metadata into objects.
By sending crafted X-Minio-Replication-* headers in a normal PutObject request, an attacker can influence how objects are treated and protected on the server, potentially weakening data security or bypassing intended encryption controls in certain deployments.
Affected context
This vulnerability appears in MinIO object storage deployments where:
- Users are granted s3:PutObject permissions on one or more buckets.
- The server uses internal metadata and X-Minio-Replication-* headers to manage server-side encryption and/or replication.
- There is an assumption that encryption-related metadata is controlled only by trusted internal components or tightly scoped roles.
In such environments, untrusted clients can still reach the PutObject API and influence metadata that should typically be reserved for internal or more privileged workflows.
Exploit preconditions
- Attack surface: Network-facing S3-compatible PutObject API on the MinIO server.
- Required access: Any authenticated account or role with s3:PutObject permission on a target bucket.
- Trigger point: Submission of a normal PutObject request containing crafted X-Minio-Replication-* headers.
- Why exploitation is possible: The extractMetadataFromMime() logic does not sufficiently distinguish between client-controlled replication headers and internal server-side encryption metadata, allowing user-supplied values to be accepted without proper authorization checks.
Why this happens
The root cause is insufficient authentication/authorization around sensitive control metadata in the request path, mapping to CWE-287: Improper Authentication in the broader sense of failing to verify that the calling principal is allowed to manipulate internal encryption-related metadata.
The extractMetadataFromMime() function treats X-Minio-Replication-* headers as trusted inputs and translates them into internal server-side encryption metadata even when provided by general clients with only PutObject rights. This breaks the trust boundary between internal control-plane operations and regular data-plane writes, allowing unprivileged users to affect security-critical configuration on a per-object basis.
Potential impact
- Attackers with basic write access could influence server-side encryption behavior for specific objects.
- Objects may be stored with unintended encryption settings or metadata, potentially undermining compliance-driven encryption policies.
- Internal replication or encryption workflows could be confused or misrouted due to forged replication metadata.
- Security monitoring and audit trails may be obscured if objects appear to be processed under misleading encryption/replication metadata.
General mitigation guidance
Effective mitigation focuses on tightening control over security-sensitive metadata and enforcing clear trust boundaries between internal headers and client-controlled fields.
Recommended patterns include:
- Treating replication and encryption control headers as privileged inputs, validating that only specific roles or subsystems can set or modify them.
- Separating internal metadata paths from public request-derived metadata, ensuring internal flags cannot be set solely via client headers.
- Implementing explicit authorization checks when mapping headers into encryption-related metadata, rather than relying only on general PutObject permissions.
- Designing object metadata handling so that safe, default encryption policies are applied regardless of client-supplied replication headers unless a more privileged context is established.
How teams detect issues like this
Detection can rely on both code-centric and operational approaches:
- Static analysis and review: Look for code paths where HTTP headers (especially X-Minio-Replication-* or similar control headers) are mapped directly into internal metadata or encryption settings without explicit authorization checks.
- Configuration and policy review: Examine IAM-style policies to identify roles that have broad s3:PutObject access in sensitive buckets, and verify whether additional constraints on metadata manipulation are enforced.
- Runtime monitoring: Log and alert on unusual or high-volume use of replication-related headers from general client accounts, particularly when combined with object uploads to sensitive buckets.
- Automated tooling: Use security scanners or custom linters that flag uses of replication or encryption headers in request parsing logic as requiring explicit privilege validation.

