Skip to content

Cloud credential CRUD stores whitespace-padded keys and reports no-op updates as successful writes #7420

Backlog

Description

@NUAAwqy

Phenomenon

Two lifecycle gaps in the cloud-credential CRUD let bad input in and report no-ops as successful writes:

  1. CloudCredentialService.create stores name / accessKey / secretKey exactly as pasted. An accessKey or secretKey pasted with a trailing space or newline is saved "successfully" and then breaks every cloud signature check (SignatureDoesNotMatch), and a whitespace-padded accessKey also slips past the vendor + accessKey uniqueness check ("AKID " and "AKID" pass as distinct). CloudCredentialService.update has the same gap for a rotated secret.
  2. CloudCredentialService.update with only an id (no name, secretKey or remark) "succeeds": the write path still bumps gmt_modified, evicts every cached cloud client for that credential (AliyunClientFactory / TencentClientFactory invalidate) and records an UPDATE_CLOUD_CREDENTIAL SUCCESS audit row - a no-op reported as a successful update.

Root cause

Paste hygiene is missing at the service boundary (whitespace is never trimmed before validation and persistence), and the partial-update path has no "at least one field" guard, so an empty change set flows into a write that reports metadata and side effects for work it did not do.

Impact

Operators create credentials that look valid but can never authenticate (whitespace in the key material), and the credential name-uniqueness check can be bypassed by whitespace; empty update calls fabricate modification metadata, cache invalidations and audit trail entries. Same failure-as-success class the project has been cleaning up.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions