T08 · Insecure Dependencies
- Location
references/apm.md:323- Finding
Unauthenticated HTTP Download of Executable Java Agent
- Content
View full analysis
Vulnerability Details
File Location:
references/apm.md:323-329, 394-405
Vulnerability Type: Unauthenticated remote component retrieval
Risk Level: HighVulnerable instructions:
markdown | Network | URL Pattern | |---------|-------------| | Public | `http://arms-apm-{regionId}.oss-{regionId}.aliyuncs.com/<path>` | | VPC | `http://arms-apm-{regionId}.oss-{regionId}-internal.aliyuncs.com/<path>` |bash wget -T 30 -t 3 "http://arms-apm-{regionId}.oss-{regionId}[-internal].aliyuncs.com/AliyunJavaAgent.zip" -O AliyunJavaAgent.zip unzip AliyunJavaAgent.zip -d /opt/bash # ARMS_LICENSE_KEY is exported from apm configuration get (see onboarding.md); never inline the token java -javaagent:/opt/AliyunJavaAgent/aliyun-java-agent.jar \ -Darms.licenseKey="$ARMS_LICENSE_KEY" \ -Darms.appName={appName} \ -Darms.workspace={workspace} \ -jar app.jarTechnical Analysis
The manual Java onboarding workflow downloads
AliyunJavaAgent.zipover plain HTTP. HTTP provides neither server authentication nor transport integrity. The instructions also do not require verification of a cryptographic signature or an expected digest before extracting the archive.The downloaded JAR is subsequently supplied to the JVM through
-javaagent. A Java agent executes inside the target JVM and can instrument classes, inspect application memory, access process-level credentials, and perform actions with the operating-system privileges of the application process. Consequently, modification of the HTTP response is not merely a content-integrity issue—it creates a direct remote code-execution path.Attack Path
- A user or Agent follows the manual Java-agent onboarding instructions.
- The host requests
AliyunJavaAgent.zipover HTTP. - An attacker capable of intercepting or modifying network traffic substitutes a malicious archive.
- The workflow extracts the substituted ...[truncated 828 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace every HTTP download URL with an HTTPS endpoint and reject protocol downgrades.
- Publish and pin an expected SHA-256 or stronger digest for each supported agent release.
- Prefer a vendor signature and verify it against a pinned, trusted public key before extraction.
- Abort installation if transport, signature, or digest validation fails.
- Download into a restricted temporary directory, validate the archive, and inspect archive paths before extracting into
/opt/. - Pin a specific agent version rather than implicitly retrieving mutable content.
- Document the verification commands directly alongside the download and make them mandatory rather than optional.
