docker/cli · warning
warning: potential malicious behavior - trust data mismatch…
Error message
warning: potential malicious behavior - trust data mismatch for remote repository %s: %v
What it means
Returned by NotaryError (trust.go:246) for trustpinning.ErrRootRotationFail, trustpinning.ErrValidationFail, or signed.ErrInvalidKeyType. These are TUF security failures: root key rotation did not validate, trust pinning validation failed, or a key had an unexpected type. The 'warning: potential malicious behavior' prefix signals possible tampering or a compromised/rotated root, and the client refuses to proceed to protect the user.
Solutions
- Confirm with the repository owner whether a root rotation was intentional; if so, update the client trust pinning (cert/root) to match.
- Do NOT bypass: investigate before disabling trust pinning, since the error exists to flag tampering.
- Re-import the correct root certificate / pinned key into the trust configuration.
- If confirmed malicious, rotate all keys, re-initialize trust, and revoke the compromised material.
Example fix
# before: pinned root no longer matches server root -> ErrValidationFail DOCKER_CONTENT_TRUST=1 docker pull example.com/app:latest # after (only after owner confirms legit rotation): update trust pinning # configure new pinned root cert in ~/.docker/trust, then: DOCKER_CONTENT_TRUST=1 docker pull example.com/app:latest
Defensive patterns
Strategy: validation
Validate before calling
// Verify the pinned root matches the server root before operations
if pinnedRoot != "" {
if err := validateRootAgainstPin(server, pinnedRoot); err != nil {
return fmt.Errorf("root does not match trust pin; confirm legit rotation: %w", err)
}
} Try / catch
// Do NOT auto-bypass; surface to the operator for a security decision
if errors.Is(err, trustpinning.ErrValidationFail) ||
errors.Is(err, trustpinning.ErrRootRotationFail) ||
errors.Is(err, signed.ErrInvalidKeyType) {
return fmt.Errorf("possible tampering; halt and verify with repo owner: %w", err)
} Prevention
- Never silently disable trust pinning when this fires.
- Coordinate root rotations and update client pinning deliberately.
- Keep notary client and server versions aligned on key types.
When it happens
Trigger: A trusted operation where the root role metadata changed in a way that fails continuous key rotation checks, the trust pinning config (e.g. a pinned root CA or key) does not match the server-presented root, or a role uses a key type the client deems invalid. NotaryError maps all three to this single security warning.
Common situations: Legitimate root key rotation not yet configured in the client's trust pinning, a compromised or attacker-controlled Notary server presenting a different root, a DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE / pinned-cert mismatch, or version skew between notary client and server key types.
Related errors
- error: remote repository
- no valid signing keys for delegation roles
- cannot push a digest reference
- no targets found, provide a specific tag in order to sign it
- could not decrypt key
AI-assisted analysis of docker/cli@4f84911bfe (2026-08-07).
Data as JSON: /api/errors/c0710a3fe6dbe1de.
Report an issue: GitHub.
Appendix: source
Thrown at cmd/docker-trust/internal/trust/trust.go:246
}
}
// NotaryError formats an error message received from the notary service
func NotaryError(repoName string, err error) error {
switch err.(type) {
case *json.SyntaxError:
logrus.Debugf("Notary syntax error: %s", err)
return fmt.Errorf("error: no trust data available for remote repository %s. Try running notary server and setting DOCKER_CONTENT_TRUST_SERVER to its HTTPS address", repoName)
case signed.ErrExpired:
return fmt.Errorf("error: remote repository %s out-of-date: %v", repoName, err)
case trustmanager.ErrKeyNotFound:
return fmt.Errorf("error: signing keys for remote repository %s not found: %v", repoName, err)
case storage.NetworkError:
return fmt.Errorf("error: error contacting notary server: %v", err)
case storage.ErrMetaNotFound:
return fmt.Errorf("error: trust data missing for remote repository %s or remote repository not found: %v", repoName, err)
case trustpinning.ErrRootRotationFail, trustpinning.ErrValidationFail, signed.ErrInvalidKeyType:
return fmt.Errorf("warning: potential malicious behavior - trust data mismatch for remote repository %s: %v", repoName, err)
case signed.ErrNoKeys:
return fmt.Errorf("error: could not find signing keys for remote repository %s, or could not decrypt signing key: %v", repoName, err)
case signed.ErrLowVersion:
return fmt.Errorf("warning: potential malicious behavior - trust data version is lower than expected for remote repository %s: %v", repoName, err)
case signed.ErrRoleThreshold:
return fmt.Errorf("warning: potential malicious behavior - trust data has insufficient signatures for remote repository %s: %v", repoName, err)
case client.ErrRepositoryNotExist:
return fmt.Errorf("error: remote trust data does not exist for %s: %v", repoName, err)
case signed.ErrInsufficientSignatures:
return fmt.Errorf("error: could not produce valid signature for %s. If Yubikey was used, was touch input provided?: %v", repoName, err)
default:
return err
}
}
// AddToAllSignableRoles attempts to add the image target to all the top level
// delegation roles we can (based on whether we have the signing key and whether
// the role's path allows us to).View on GitHub (pinned to 4f84911bfe)