{"record":{"id":"c0710a3fe6dbe1de","repo":"docker/cli","slug":"warning-potential-malicious-behavior-trust-data","errorCode":null,"errorMessage":"warning: potential malicious behavior - trust data mismatch for remote repository %s: %v","messagePattern":"warning: potential malicious behavior - trust data mismatch for remote repository (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/docker-trust/internal/trust/trust.go","lineNumber":246,"sourceCode":"\t}\n}\n\n// NotaryError formats an error message received from the notary service\nfunc NotaryError(repoName string, err error) error {\n\tswitch err.(type) {\n\tcase *json.SyntaxError:\n\t\tlogrus.Debugf(\"Notary syntax error: %s\", err)\n\t\treturn 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)\n\tcase signed.ErrExpired:\n\t\treturn fmt.Errorf(\"error: remote repository %s out-of-date: %v\", repoName, err)\n\tcase trustmanager.ErrKeyNotFound:\n\t\treturn fmt.Errorf(\"error: signing keys for remote repository %s not found: %v\", repoName, err)\n\tcase storage.NetworkError:\n\t\treturn fmt.Errorf(\"error: error contacting notary server: %v\", err)\n\tcase storage.ErrMetaNotFound:\n\t\treturn fmt.Errorf(\"error: trust data missing for remote repository %s or remote repository not found: %v\", repoName, err)\n\tcase trustpinning.ErrRootRotationFail, trustpinning.ErrValidationFail, signed.ErrInvalidKeyType:\n\t\treturn fmt.Errorf(\"warning: potential malicious behavior - trust data mismatch for remote repository %s: %v\", repoName, err)\n\tcase signed.ErrNoKeys:\n\t\treturn fmt.Errorf(\"error: could not find signing keys for remote repository %s, or could not decrypt signing key: %v\", repoName, err)\n\tcase signed.ErrLowVersion:\n\t\treturn fmt.Errorf(\"warning: potential malicious behavior - trust data version is lower than expected for remote repository %s: %v\", repoName, err)\n\tcase signed.ErrRoleThreshold:\n\t\treturn fmt.Errorf(\"warning: potential malicious behavior - trust data has insufficient signatures for remote repository %s: %v\", repoName, err)\n\tcase client.ErrRepositoryNotExist:\n\t\treturn fmt.Errorf(\"error: remote trust data does not exist for %s: %v\", repoName, err)\n\tcase signed.ErrInsufficientSignatures:\n\t\treturn fmt.Errorf(\"error: could not produce valid signature for %s.  If Yubikey was used, was touch input provided?: %v\", repoName, err)\n\tdefault:\n\t\treturn err\n\t}\n}\n\n// AddToAllSignableRoles attempts to add the image target to all the top level\n// delegation roles we can (based on whether we have the signing key and whether\n// the role's path allows us to).","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cmd/docker-trust/internal/trust/trust.go#L228-L264","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before: pinned root no longer matches server root -> ErrValidationFail\nDOCKER_CONTENT_TRUST=1 docker pull example.com/app:latest\n\n# after (only after owner confirms legit rotation): update trust pinning\n# configure new pinned root cert in ~/.docker/trust, then:\nDOCKER_CONTENT_TRUST=1 docker pull example.com/app:latest","handlingStrategy":"validation","validationCode":"// Verify the pinned root matches the server root before operations\nif pinnedRoot != \"\" {\n    if err := validateRootAgainstPin(server, pinnedRoot); err != nil {\n        return fmt.Errorf(\"root does not match trust pin; confirm legit rotation: %w\", err)\n    }\n}","typeGuard":null,"tryCatchPattern":"// Do NOT auto-bypass; surface to the operator for a security decision\nif errors.Is(err, trustpinning.ErrValidationFail) ||\n   errors.Is(err, trustpinning.ErrRootRotationFail) ||\n   errors.Is(err, signed.ErrInvalidKeyType) {\n    return fmt.Errorf(\"possible tampering; halt and verify with repo owner: %w\", err)\n}","preventionTips":["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."],"tags":["trust","notary","security","key-rotation"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}