Uh oh!
There was an error while loading. Please reload this page.
fix: validate Alibaba Cloud image ID and fix HOSTKEY input validation order - #1019
Merged
Conversation
- Add validate_resource_name check for ALIYUN_IMAGE_ID env var in alibabacloud create_server, consistent with other providers (Contabo, Webdock) that validate user-controllable image identifiers - Move HOSTKEY location validation before _pick_instance_preset call, which uses the location in an API request — validates input before use rather than after Agent: security-auditor Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
louisgv
approved these changes
Feb 13, 2026
louisgv
left a comment
Collaborator
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Findings
- No security issues found
- This PR is itself a security improvement: adds missing
validate_resource_namecheck for Alibaba Cloud image ID and fixes HostKey input validation order to validate location before it's used in API calls
Tests
- bash -n: PASS (both alibabacloud/lib/common.sh and hostkey/lib/common.sh)
- bun test: N/A (no .ts changes)
- curl|bash pattern: OK (unchanged)
- macOS compat: OK (no incompatible patterns introduced)
-- security/pr-reviewer
louisgv
approved these changes
Feb 13, 2026
louisgv
left a comment
Collaborator
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Findings
- No security issues found
- MEDIUM fix validated:
validate_resource_namecorrectly added forALIYUN_IMAGE_ID— the default image ID (ubuntu_24_04_x64_20G_alibase_20240812.vhd) passes the^[a-zA-Z0-9_.-]{1,63}$regex - MEDIUM fix validated: HOSTKEY
validate_region_namefor location correctly moved before_pick_instance_preset()which uses it in an API call
Tests
- bash -n: PASS (both alibabacloud/lib/common.sh and hostkey/lib/common.sh)
- bun test: 10357 pass / 137 fail (pre-existing failures, same as main which has 133 fail — difference is test flakiness, not related to this PR)
- curl|bash pattern: OK (both files have proper local-or-remote source fallback)
- macOS compat: OK (no bash 3.x incompatible patterns in changes)
-- security/pr-reviewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
validate_resource_namecheck forALIYUN_IMAGE_IDenv var in Alibaba Cloudcreate_server, consistent with other providers (Contabo, Webdock, BinaryLane) that validate user-controllable image identifiersvalidate_region_namefor location before_pick_instance_preset()call, which passes the location to an API request — input should be validated before use, not afterFindings
Fixed in this PR (MEDIUM)
ALIYUN_IMAGE_IDnot validated: The env var was passed directly to thealiyunCLI withoutvalidate_resource_namevalidation. While not exploitable for command injection (properly quoted CLI argument), this is inconsistent with other providers._pick_instance_preset()calls_list_instance_presets()which makes an API request with the unvalidatedlocationparameter. Validation happened afterward increate_server. Now validation occurs before the API call.Already addressed
invalidate_cloud_key()— fixed in PR fix: validate provider name in invalidate_cloud_key and improve key validation #1017key-server.ts— fixed in PR fix: validate provider name in invalidate_cloud_key and improve key validation #1017No NEW HIGH/CRITICAL issues found
Scanned all recently added/modified files including:
Test plan
bash -n alibabacloud/lib/common.shpassesbash -n hostkey/lib/common.shpassesubuntu_24_04_x64_20G_alibase_20240812.vhd) passesvalidate_resource_name-- refactor/security-auditor