Skip to content

[Hardening] F-21: Base64-Encoded User Data Containing Plain Text Passwords in DB. #14530

Open

Description

@davift

The required feature described as a wish

Description: The userdata parameter supplied to DeployVMCmd is stored base64-encoded (not encrypted) in DB. Base64 does not offer adequate protection for sensitive information, and in practice the decoded cloud-init frequently contains plaintext passwords (plain_text_passwd, passwd, chpasswd). Because user data is opaque to the platform, its contents cannot be selectively filtered. The field must be treated as sensitive in its entirety.

Image

Affected Components: Management API / DB (cloud.async_job, column job_cmd_info).

Impact: Anyone with read access to the database can base64-decode the stored user data and recover any plaintext credentials the user set in their cloud-init, including passwords for accounts configured with passwordless sudo, thereby granting effective root on the guest.

Steps to Reproduce:

  • Deploy an instance with cloud-init userdata that sets a user password (e.g., plain_text_passwd or a chpasswd block).
  • Query the database:
    • mysql> SELECT job_cmd_info FROM async_job WHERE job_cmd LIKE '%DeployVMCmd%' AND job_cmd_info LIKE '%"userdata":%';
  • Base64-decode the userdata value and observe the embedded credentials in cleartext.

Recommended Remediation: Redact or omit the userdata attribute from params before the toJson(params) serialization (this is the same code site that F-18 identifies for the top-level password parameter). It is recommended to treat the whole cloud-init field as sensitive, like in F-19.

https://github.com/apache/cloudstack/blob/4.22.0.0/server/src/main/java/com/cloud/api/ApiServer.java#L825

See more examples:

Image

Activity

  1. github-actions commented on Oct 30, 2026

    @github-actions

    Warning

    threat detection engine error
    The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

    What happened

    The threat detection engine failed to produce results.

    Review the workflow run logs for details.

    🎯 Triage report

    The report says the userdata parameter of DeployVMCmd is stored base64-encoded in the async_job.job_cmd_info column, so anyone with DB read access can decode cloud-init content that often includes plaintext passwords. The suggested fix is to redact userdata before the params are serialised in ApiServer. The same pattern is in F-18 and F-19 of this hardening series.

    Scope check for maintainers: THREAT_MODEL.md §3 item 6 and Q10 say user-data is tenant-controlled guest customisation and is not a CloudStack-side injection surface. §9 says the database is trusted for its own security, but credential handling is in scope. Whether leaking tenant user-data via DB read access is in scope needs a maintainer decision.

    Reporting channel: SECURITY.md asks for suspected vulnerabilities to be reported privately to security@apache.org and not in public issues. Maintainers may want to confirm whether this report should be handled there.

    📊 Assessment

    Dimension Value Reasoning
    Type type:security Report describes credential exposure in DB content
    Component component:database Storage of job_cmd_info in async_job; the redaction point is in the API layer
    Severity n/a Not assessed; depends on the scope decision above
    Labels type:security, component:database
    Coding agent Not suitable Scope decision and security review needed before any change

    🔗 Similar issues

    💡 Notes and suggestions
    • The reporter's SQL query and decoding steps are in the issue. Only maintainers should decide whether to keep reproduction details public.
    • Redaction at serialisation (as suggested) would also need to cover any other path that stores the DeployVMCmd params.

    Generated by Daily Issue Triage · copilot · haiku55 · ~3 AIC · ⊞ 3.8K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@139fa09ef17cde4135e696ff8e7af09bc5ddfa6e
    
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