René's URL Explorer Experiment


Title: Plaintext VM User-Data and SSH Public Key Log Exposure in Baremetal Kickstart PXE Plugin · Issue #13307 · apache/cloudstack · GitHub

Open Graph Title: Plaintext VM User-Data and SSH Public Key Log Exposure in Baremetal Kickstart PXE Plugin · Issue #13307 · apache/cloudstack

X Title: Plaintext VM User-Data and SSH Public Key Log Exposure in Baremetal Kickstart PXE Plugin · Issue #13307 · apache/cloudstack

Description: Advisory Details Title: Plaintext VM User-Data and SSH Public Key Log Exposure in Baremetal Kickstart PXE Plugin Description: A critical sensitive information leak vulnerability (CWE-532) exists in the Apache CloudStack Baremetal Kicksta...

Open Graph Description: Advisory Details Title: Plaintext VM User-Data and SSH Public Key Log Exposure in Baremetal Kickstart PXE Plugin Description: A critical sensitive information leak vulnerability (CWE-532) exists in...

X Description: Advisory Details Title: Plaintext VM User-Data and SSH Public Key Log Exposure in Baremetal Kickstart PXE Plugin Description: A critical sensitive information leak vulnerability (CWE-532) exists in...

Opengraph URL: https://github.com/apache/cloudstack/issues/13307

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Plaintext VM User-Data and SSH Public Key Log Exposure in Baremetal Kickstart PXE Plugin","articleBody":"### Advisory Details\n\n**Title**: Plaintext VM User-Data and SSH Public Key Log Exposure in Baremetal Kickstart PXE Plugin\n\n**Description**:\n\nA critical sensitive information leak vulnerability (CWE-532) exists in the Apache CloudStack Baremetal Kickstart PXE plugin. When orchestrating virtual instances on baremetal hosts via PXE booting, the management server communicates tenant VM metadata (including custom user-data and SSH public keys) by executing command-line scripts via SSH on the PXE server node. \n\nDue to a flawed sanitization logic in `SSHCmdHelper.java`'s `sshExecuteCmdOneShot()` execution, which only attempts to mask or truncate commands by splitting on the keystore file token `\"cloud.jks\"` (`KeyStoreUtils.KS_FILENAME`), all command strings lacking `\"cloud.jks\"` are written fully unmasked and exposed in system debug logs. As a result, standard tenant initialization passwords, keys, and SSH public keys are logged in plaintext, allowing any user or process with system debug log access to compromise tenant virtualization environments.\n\n### Summary\n\nAn incomplete logging sanitization mechanism in the Baremetal Kickstart PXE resource flow allows plaintext sensitive VM initialization user-data and SSH public keys to be exposed in standard system debug logs, compromising client environment credentials.\n\n### Details\n\n#### Root Cause Analysis\n\nWhen deploying or starting virtual machines in a baremetal environment, the `VmDataCommand` is dispatched. The execution flow is traced as follows:\n```\n[User API Client (deployVirtualMachine / updateVirtualMachine)] \n  --\u003e [UserVmManagerImpl / CommandSetupHelper.generateVmDataCommand]\n  --\u003e [VmDataCommand DTO (userdata \u0026 public keys)]\n  --\u003e [AgentManagerImpl.send / BaremetalKickStartPxeResource.execute]\n```\n\nWithin `plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/networkservice/BaremetalKickStartPxeResource.java`'s `execute(VmDataCommand cmd)` method:\n```java\n    private Answer execute(VmDataCommand cmd) {\n        com.trilead.ssh2.Connection sshConnection = new com.trilead.ssh2.Connection(_ip, 22);\n        try {\n            List\u003cString[]\u003e vmData = cmd.getVmData();\n            StringBuilder sb = new StringBuilder();\n            for (String[] data : vmData) {\n                String folder = data[0];\n                String file = data[1];\n                String contents = (data[2] == null) ? \"none\" : data[2];\n                sb.append(cmd.getVmIpAddress());\n                sb.append(\",\");\n                sb.append(folder);\n                sb.append(\",\");\n                sb.append(file);\n                sb.append(\",\");\n                sb.append(contents);\n                sb.append(\";\");\n            }\n            String arg = StringUtils.stripEnd(sb.toString(), \";\");\n\n            sshConnection.connect(null, 60000, 60000);\n            if (!sshConnection.authenticateWithPassword(_username, _password)) {\n                logger.debug(\"SSH Failed to authenticate with user {} credentials\", _username);\n                throw new ConfigurationException(String.format(\"Cannot connect to PING PXE server(IP=%1$s, username=%2$s\", _ip, _username));\n            }\n\n            String script = String.format(\"python /usr/bin/baremetal_user_data.py '%s'\", arg);\n            if (!SSHCmdHelper.sshExecuteCmd(sshConnection, script)) {\n                return new Answer(cmd, false, \"Failed to add user data, command:\" + script);\n            }\n```\n\nThe constructed command resolves to:\n`\"python /usr/bin/baremetal_user_data.py '10.0.0.10,metadata,userdata,PlaintextSuperSecretPassword123;10.0.0.10,metadata,sshkey,ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuVariantPublicSSHKey'\"`\n\nThis command string contains the plaintext VM user-data and SSH public keys.\n\nInside `utils/src/main/java/com/cloud/utils/ssh/SSHCmdHelper.java`'s `sshExecuteCmdOneShot()` execution:\n```java\npublic static SSHCmdResult sshExecuteCmdOneShot(com.trilead.ssh2.Connection sshConnection, String cmd) throws SshException {\n    LOGGER.debug(\"Executing cmd: \" + cmd.split(KeyStoreUtils.KS_FILENAME)[0]);\n    ...\n    if (!StringUtils.isAllEmpty(result.getStdOut(), result.getStdErr())) {\n           LOGGER.debug(\"SSH command: \" + cmd.split(KeyStoreUtils.KS_FILENAME)[0] + ...);\n    }\n}\n```\n\nBecause `\"cloud.jks\"` (`KeyStoreUtils.KS_FILENAME`) is not present in the Python script execution, the split operation fails to truncate any portion of the command, logging the entire command—and thus the sensitive user-data and keys—directly to standard system debug logs (e.g., `vmops.log` or `management-server.log`).\n\n### PoC\n\n#### Prerequisites\n\n* Target CloudStack setup must have the Baremetal Kickstart PXE plugin configured.\n* System debug log output enabled.\n\n#### Reproduction Steps\n\n1. Set up the isolated laboratory environment:\n   Download: [docker-compose.yml](https://gist.github.com/YLChen-007/295622493e4f303103755f232ff5dc20)\n   Run: `docker compose up -d`\n\n2. Download and run the defect verification script simulating Kickstart PXE metadata transmission command logging:\n   Download: [verification_test_Issue-cloudstack-12030.py](https://gist.github.com/YLChen-007/001a9614e0f3daffe6ed420e8e62bfe2)\n   Run: `python3 verification_test_Issue-cloudstack-12030.py`\n\n3. Download and run the scientific control group script demonstrating that the filtering logic only works under standard keystore operations containing `\"cloud.jks\"`:\n   Download: [control-masked_output.py](https://gist.github.com/YLChen-007/bd4982b3ab321a7f09ee42ce071e94e8)\n   Run: `python3 control-masked_output.py`\n\n### Log of Evidence\n\n```\n[*] Running Issue-cloudstack-12030-BaremetalKickstartPxe Sensitive Data Exposure Verification...\n[*] Defect Verification - Input Tracing:\n    - Sensitive VM User-Data: PlaintextSuperSecretPassword123\n    - Sensitive SSH Public Key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuVariantPublicSSHKey\n\n--- EXPERIMENT RESULTS (DEBUG LOGS) ---\n[*] Logged VmDataCommand: python /usr/bin/baremetal_user_data.py '10.0.0.10,metadata,userdata,PlaintextSuperSecretPassword123;10.0.0.10,metadata,sshkey,ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuVariantPublicSSHKey'\n---------------------------------------\n\n[+] SUCCESS: Plaintext sensitive credentials leaked successfully in standard debug logs!\n[+] Status: DEFECT-CONFIRMED\n```\n\n### Impact\n\n* **Vulnerability Type**: CWE-532 (Insertion of Sensitive Information into Log File)\n* **Impact**: Unauthenticated exposure of tenant environment initialization metadata, including plaintext custom user-data (passwords, access keys, script tokens) and SSH public keys. This allows system administrators or local attackers with log file read access to fully compromise tenant virtual machines and API interfaces.\n\n### Affected products\n\n- **Ecosystem**: maven\n- **Package name**: org.apache.cloudstack:cloudstack\n- **Affected versions**: \u003c= 4.22.1.0\n- **Patched versions**: \u003cNone\u003e\n\n### Severity\n\n- **Severity**: High\n- **Vector string**: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N\n\n### Weaknesses\n\n- **CWE**: CWE-532: Insertion of Sensitive Information into Log File\n\n### Occurrences\n\n| Permalink | Description |\n| :--- | :--- |\n| [https://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/utils/src/main/java/com/cloud/utils/ssh/SSHCmdHelper.java#L166-L168](https://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/utils/src/main/java/com/cloud/utils/ssh/SSHCmdHelper.java#L166-L168) | Flawed logging logic that relies on `KeyStoreUtils.KS_FILENAME` split-sanitization in `sshExecuteCmdOneShot`. |\n| [https://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/networkservice/BaremetalKickStartPxeResource.java#L111-L141](https://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/networkservice/BaremetalKickStartPxeResource.java#L111-L141) | Execution of `VmDataCommand` using command string containing raw metadata via `SSHCmdHelper.sshExecuteCmd`. |\n| [https://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/utils/src/main/java/com/cloud/utils/ssh/SSHCmdHelper.java#L228-L232](https://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/utils/src/main/java/com/cloud/utils/ssh/SSHCmdHelper.java#L228-L232) | Flawed logging of the command execution output using `KS_FILENAME` split-sanitization. |","author":{"url":"https://github.com/YLChen-007","@type":"Person","name":"YLChen-007"},"datePublished":"2026-06-01T07:13:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/13307/cloudstack/issues/13307"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d9580da5-6ccb-7f9a-2f8b-ce4e4f4ea726
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8078:25AEDC:3CA39A:589061:6A4E042B
html-safe-nonceaa99885d66c9555ec3d3b2acba8246c1546850ed3dd0134b2c7667c50b23eeab
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDc4OjI1QUVEQzozQ0EzOUE6NTg5MDYxOjZBNEUwNDJCIiwidmlzaXRvcl9pZCI6IjQ2MzA0MTUxMzEzNDMxOTMxMzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace41b0aca812e0d59fe17723dfc54cb90a54fc2db45ff1df11a671cb214a6ffca
hovercard-subject-tagissue:4561097272
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/cloudstack/13307/issue_layout
twitter:imagehttps://opengraph.githubassets.com/96e02723a4c6f5540403996332d361145993b736985e1ff52cc487e7ce1f4624/apache/cloudstack/issues/13307
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/96e02723a4c6f5540403996332d361145993b736985e1ff52cc487e7ce1f4624/apache/cloudstack/issues/13307
og:image:altAdvisory Details Title: Plaintext VM User-Data and SSH Public Key Log Exposure in Baremetal Kickstart PXE Plugin Description: A critical sensitive information leak vulnerability (CWE-532) exists in...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameYLChen-007
hostnamegithub.com
expected-hostnamegithub.com
Nonedf0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6
turbo-cache-controlno-preview
go-importgithub.com/apache/cloudstack git https://github.com/apache/cloudstack.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id9759448
octolytics-dimension-repository_nwoapache/cloudstack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id9759448
octolytics-dimension-repository_network_root_nwoapache/cloudstack
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release52bde38e24398476f8eb1e0760c81346c6a00812
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/cloudstack/issues/13307#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fissues%2F13307
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fissues%2F13307
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=apache%2Fcloudstack
Reloadhttps://github.com/apache/cloudstack/issues/13307
Reloadhttps://github.com/apache/cloudstack/issues/13307
Reloadhttps://github.com/apache/cloudstack/issues/13307
Please reload this pagehttps://github.com/apache/cloudstack/issues/13307
apache https://github.com/apache
cloudstackhttps://github.com/apache/cloudstack
Notifications https://github.com/login?return_to=%2Fapache%2Fcloudstack
Fork 1.3k https://github.com/login?return_to=%2Fapache%2Fcloudstack
Star 3k https://github.com/login?return_to=%2Fapache%2Fcloudstack
Code https://github.com/apache/cloudstack
Issues 536 https://github.com/apache/cloudstack/issues
Pull requests 268 https://github.com/apache/cloudstack/pulls
Discussions https://github.com/apache/cloudstack/discussions
Actions https://github.com/apache/cloudstack/actions
Projects https://github.com/apache/cloudstack/projects
Wiki https://github.com/apache/cloudstack/wiki
Security and quality 0 https://github.com/apache/cloudstack/security
Insights https://github.com/apache/cloudstack/pulse
Code https://github.com/apache/cloudstack
Issues https://github.com/apache/cloudstack/issues
Pull requests https://github.com/apache/cloudstack/pulls
Discussions https://github.com/apache/cloudstack/discussions
Actions https://github.com/apache/cloudstack/actions
Projects https://github.com/apache/cloudstack/projects
Wiki https://github.com/apache/cloudstack/wiki
Security and quality https://github.com/apache/cloudstack/security
Insights https://github.com/apache/cloudstack/pulse
Taskhttps://github.com/apache/cloudstack/issues?q=type:"Task"
Plaintext VM User-Data and SSH Public Key Log Exposure in Baremetal Kickstart PXE Pluginhttps://github.com/apache/cloudstack/issues/13307#top
component:logginghttps://github.com/apache/cloudstack/issues?q=state%3Aopen%20label%3A%22component%3Alogging%22
https://github.com/YLChen-007
YLChen-007https://github.com/YLChen-007
on Jun 1, 2026https://github.com/apache/cloudstack/issues/13307#issue-4561097272
docker-compose.ymlhttps://gist.github.com/YLChen-007/295622493e4f303103755f232ff5dc20
verification_test_Issue-cloudstack-12030.pyhttps://gist.github.com/YLChen-007/001a9614e0f3daffe6ed420e8e62bfe2
control-masked_output.pyhttps://gist.github.com/YLChen-007/bd4982b3ab321a7f09ee42ce071e94e8
cloudstack/utils/src/main/java/com/cloud/utils/ssh/SSHCmdHelper.javahttps://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/utils/src/main/java/com/cloud/utils/ssh/SSHCmdHelper.java#L166-L168
348ce95https://github.com/apache/cloudstack/commit/348ce953a99246a756b527994f7745a7be038234
cloudstack/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/networkservice/BaremetalKickStartPxeResource.javahttps://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/networkservice/BaremetalKickStartPxeResource.java#L111-L141
348ce95https://github.com/apache/cloudstack/commit/348ce953a99246a756b527994f7745a7be038234
cloudstack/utils/src/main/java/com/cloud/utils/ssh/SSHCmdHelper.javahttps://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/utils/src/main/java/com/cloud/utils/ssh/SSHCmdHelper.java#L228-L232
348ce95https://github.com/apache/cloudstack/commit/348ce953a99246a756b527994f7745a7be038234
component:logginghttps://github.com/apache/cloudstack/issues?q=state%3Aopen%20label%3A%22component%3Alogging%22
Taskhttps://github.com/apache/cloudstack/issues?q=type:"Task"
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.