Back to skill

Security audit

umeng-analytics-integration

Security checks for vulnerabilities and agentic risk

Overview

This Android SDK integration skill matches its stated purpose, but it has unsafe project-modification and rollback behavior that users should review before installing.

Install only after reviewing the scripts and using version control or a separate disposable copy of the Android project. Avoid piping real appkeys on the command line, pin the Umeng SDK versions, do not run rollback on paths you have not manually verified, and be aware that device verification may install an APK and clear/read logcat data.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/rollback.py:18
Finding

Arbitrary Recursive Directory Deletion During Rollback

Content
View full analysis
Tuple[bool, str]: if not os.path.exists(self.backup_dir): return False, f"Backup directory does not exist: {self.backup_dir}" try: if os.path.exists(self.project_path): shutil.rmtree(self.project_path) shutil.copytree(self.backup_dir, self.project_path) return True, "Rollback completed" except Exception as e: return False, f"Rollback failed: {str(e)}" ``` ### Technical Analysis Both `backup_dir` and `project_path` originate from required command-line arguments. Converting them with `os.path.abspath()` only normalizes their syntax; it does not establish that they are safe, related, or valid Android project and backup directories. The rollback operation recursively deletes `project_path` before validating the backup contents or confirming that the backup can be restored. The implementation does not reject: - Filesystem roots or other sensitive system paths. - The current user's home directory. - Paths that are equal to or nested inside one another. - Symlink-mediated path redirection. - Directories that are not Android projects. - Backup directories that are unreadable, incomplete, or otherwise invalid. If `shutil.copytree()` fails after deletion, the target directory remains deleted. ### Attack Path 1. An attacker or operator invokes the rollback script with a sensitive directory as `--project-path`. 2. The attacker supplies any existing directory as `--backup-dir`. 3. The script confirms only that the backup path exists. 4. `shutil.rmtree()` recursively deletes the supplied project path. 5. ...[truncated 751 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/project_validator.py:20
Finding

App Module Path Traversal Allows Modification Outside the Project

Content
View full analysis
bool: required_files = [ 'build.gradle.kts', 'settings.gradle.kts', 'gradle.properties', f'{self.app_module}/build.gradle.kts', f'{self.app_module}/src/main/AndroidManifest.xml' ] for file in required_files: file_path = os.path.join(self.project_path, file) if not os.path.exists(file_path): # Alternative-file handling omitted pass ``` ```python class SDKIntegrator: def __init__(self, project_path: str, app_module: str, config: dict): self.project_path = os.path.abspath(project_path) self.app_module = app_module def _add_sdk_dependencies(self) -> bool: app_build_gradle = os.path.join( self.project_path, self.app_module, 'build.gradle.kts' ) app_build_gradle_groovy = os.path.join( self.project_path, self.app_module, 'build.gradle' ) ``` Additional write destinations are constructed using the same unrestricted value: ```python src_main = os.path.join( self.project_path, self.app_module, 'src', 'main' ) ``` ### Technical Analysis The `--app-module` command-line value is treated as a trusted relative directory name. It is not restricted to a Gradle module identifier and is not checked for absolute paths, `..` components, path separators, or canonical containment withi ...[truncated 1628 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/sdk_integrator.py:887
Finding

Unescaped App Key and Channel Permit Generated Source-Code Injection

Content
View full analysis
str: appkey = self.config['appkey'] channel = self.config['channel'] if language == 'Kotlin': return f""" UMConfigure.setLogEnabled(true) UMConfigure.preInit(this, "{appkey}", "{channel}") Thread {{ UMConfigure.init( this, "{appkey}", "{channel}", UMConfigure.DEVICE_TYPE_PHONE, null ) }}.start()""" ``` The same unsafe interpolation is used for generated Java source: ```python return f"""package {package_name}; import android.app.Application; import com.umeng.commonsdk.UMConfigure; public class UmengApplication extends Application {{ @Override public void onCreate() {{ super.onCreate(); UMConfigure.setLogEnabled(true); UMConfigure.preInit(this, "{appkey}", "{channel}"); new Thread(new Runnable() {{ @Override public void run() {{ UMConfigure.init( this, "{appkey}", "{channel}", UMConfigure.DEVICE_TYPE_PHONE, null ); }} }}).start(); }} }} """ ``` ### Technical Analysis The app key and channel are assumed to be safe string-literal contents. No validation or Kotlin/Java escaping is performed before inserting them between double quotes. An input containing a quote can terminate the generated literal. Addi ...[truncated 1480 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/sdk_integrator.py:330
Finding

Dynamic SDK Versions Create an Unsafe and Non-Reproducible Supply Chain

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/device_manager.py:310
Finding

SDK Verification Clears and Collects Device-Wide Logcat Data

Content
View full analysis
str: try: subprocess.run( ['adb', '-s', device_serial, 'logcat', '-c'], capture_output=True, timeout=5 ) result = subprocess.run( ['adb', '-s', device_serial, 'logcat', '-d'], capture_output=True, text=True, timeout=timeout ) if result.returncode == 0: return result.stdout else: return "" ``` The verifier invokes this operation after installing and launching the application: ```python if not self.device_manager.install_apk(device['serial'], apk_path): return False, "APK installation failed" if not self.device_manager.launch_app(device['serial'], package_name): pass logcat_output = self.device_manager.capture_logcat( device['serial'], timeout=30 ) ``` ### Technical Analysis The verification process first executes `adb logcat -c`, which clears the connected device's available log buffers. It then executes `adb logcat -d` without a PID, UID, package, tag, or timestamp filter. Consequently, the operation is broader than necessary to verify the target SDK. It may collect system messages and logs emitted by unrelated applications. Clearing the global log buffer is destructive and can remove diagnostics needed by the device owner or other developers. The main workflow currently does not call step 6, but direct execution of `sdk_verifier.py` reaches this behavior. ### Attack Path 1. Connect an authorized Android device containing logs from system components or unrelated applications. 2. Run `scripts/sdk_verifier.py` against a project. 3. The ve ...[truncated 775 chars]
Remediation
View remediation
`. 4. Add tag and priority filters for the SDK where reliable tags are available. 5. Stream only for the short verification interval instead of dumping all available logs. 6. Discard unrelated lines immediately rather than retaining the complete output. 7. Clearly disclose APK installation, application launch, and log access before performing them. 8. Require explicit confirmation before modifying a physical device. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (52)

External Script Fetching

High
Category
Supply Chain
Confidence
91% confidence
Finding

The guide instructs users to download and unpack external tooling directly from the internet with wget and unzip, but provides no integrity verification such as checksums, signatures, or pinned provenance. Because these tools are then placed into the Android SDK path and later used in the build environment, a compromised download source, MITM position, or substituted artifact could lead to execution of attacker-controlled tooling.

Content

Scanner excerpt · OPENCLAW_TEST_GUIDE.md (reported line 58)May include surrounding context.

md
sudo snap install android-studio --classic

# 方法2: 命令行安装
sudo apt install wget unzip
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
mkdir -p $HOME/Android/Sdk/cmdline-tools

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The skill advertises environment checks, project validation, build verification, and logcat verification, but the implementation reportedly omits several of these steps while performing an undeclared full-project backup. This weakens informed consent and can create unsafe assumptions about what was validated before code and configuration changes were made.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill advertises environment checks, project validation, build verification, and logcat verification, but the implementation reportedly omits several of these steps while performing an undeclared full-project backup. This weakens informed consent and can create unsafe assumptions about what was validated before code and configuration changes were made.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The skill advertises environment checks, project validation, build verification, and logcat verification, but the implementation reportedly omits several of these steps while performing an undeclared full-project backup. This weakens informed consent and can create unsafe assumptions about what was validated before code and configuration changes were made.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

When repository configuration cannot be found, the script may create a new settings.gradle/settings.gradle.kts equivalent with hard-coded rootProject.name and include(":app"), overwriting or fabricating core build configuration. In an integration tool, silently replacing project-wide build settings can break module structure, alter dependency resolution, and cause unsafe supply-chain behavior by changing how the whole project resolves artifacts.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L010将sdk_verifier.py描述为包含“APK安装/logcat”验证,且技能清单与manifest也宣称包含logcat验证;但L163-L166又明确写明这些部分“本次跳过”“不需要测试”。这不是单纯信息不完整,而是对该技能当前测试/验证范围给出了相互冲突的说明。

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · OPENCLAW_TEST_GUIDE.md (reported line 47)May include surrounding context.

  1. 安装Java 17+
bash
sudo apt update
sudo apt install openjdk-17-jdk
java -version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · OPENCLAW_TEST_GUIDE.md (reported line 48)May include surrounding context.

  1. 安装Java 17+
bash
sudo apt update
sudo apt install openjdk-17-jdk
java -version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · OPENCLAW_TEST_GUIDE.md (reported line 55)May include surrounding context.

  1. 安装Java 17+
bash
sudo apt update
sudo apt install openjdk-17-jdk
java -version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 222)May include surrounding context.

  1. 安装Java 17+
bash
sudo apt update
sudo apt install openjdk-17-jdk
java -version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · OPENCLAW_TEST_GUIDE.md (reported line 58)May include surrounding context.

md
sudo snap install android-studio --classic

# 方法2: 命令行安装
sudo apt install wget unzip
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
mkdir -p $HOME/Android/Sdk/cmdline-tools

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · OPENCLAW_TEST_GUIDE.md (reported line 172)May include surrounding context.

md
sudo snap install android-studio --classic

# 方法2: 命令行安装
sudo apt install wget unzip
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
mkdir -p $HOME/Android/Sdk/cmdline-tools

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 197)May include surrounding context.

md
sudo snap install android-studio --classic

# 方法2: 命令行安装
sudo apt install wget unzip
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
mkdir -p $HOME/Android/Sdk/cmdline-tools

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 225)May include surrounding context.

md
sudo snap install android-studio --classic

# 方法2: 命令行安装
sudo apt install wget unzip
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
mkdir -p $HOME/Android/Sdk/cmdline-tools

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/env_checker.py (reported line 237)May include surrounding context.

python
sudo snap install android-studio --classic

# 方法2: 命令行安装
sudo apt install wget unzip
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
mkdir -p $HOME/Android/Sdk/cmdline-tools

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/env_checker.py (reported line 251)May include surrounding context.

python
sudo snap install android-studio --classic

# 方法2: 命令行安装
sudo apt install wget unzip
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
mkdir -p $HOME/Android/Sdk/cmdline-tools

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guide shows a real-looking appkey being piped on the command line in a non-interactive example. Supplying secrets this way can expose them through shell history, CI logs, terminal capture, or process inspection, which is especially relevant because this skill is explicitly designed for automation and non-interactive execution.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill describes operations that require shell execution, environment access, and read/write modification of an Android project, but it does not declare any explicit tool scope or permission boundaries. This creates a dangerous trust gap: an agent may execute broad filesystem and shell actions without the user being clearly informed of the capability envelope, increasing the chance of unintended destructive or overbroad changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill automates edits to Gradle files, manifests, ProGuard rules, and Application code, yet the description does not prominently warn that existing project files will be modified automatically. In the context of an Android integration skill with file_write and shell capability, missing this warning makes accidental changes and trust misuse more likely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Docstrings, prompts, and status messages throughout the file are presented only in Chinese, which imposes a specific language on users without opt-in. The file does not indicate that the skill is intentionally region-specific or provide any mechanism to select another language.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/device_manager.py (reported line 35)May include surrounding context.

python
print("\n📱 检测Android设备...\n")
        
        try:
            result = subprocess.run(
                ['adb', 'devices', '-l'],
                capture_output=True,
                text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/device_manager.py (reported line 234)May include surrounding context.

python
print(f"  APK路径: {apk_path}\n")
        
        try:
            result = subprocess.run(
                ['adb', '-s', device_serial, 'install', '-r', apk_path],
                capture_output=True,
                text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/device_manager.py (reported line 272)May include surrounding context.

python
try:
            # 获取启动Activity
            result = subprocess.run(
                ['adb', '-s', device_serial, 'shell', 'cmd', 'package', 'resolve-activity', '--brief', package_name],
                capture_output=True,
                text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/device_manager.py (reported line 285)May include surrounding context.

python
activity = lines[-1]  # 最后一行是Activity
                
                # 启动应用
                subprocess.run(
                    ['adb', '-s', device_serial, 'shell', 'am', 'start', '-n', activity],
                    capture_output=True,
                    timeout=10

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/device_manager.py (reported line 295)May include surrounding context.

python
return True
            else:
                # 如果无法获取Activity,使用monkey启动
                subprocess.run(
                    ['adb', '-s', device_serial, 'shell', 'monkey', '-p', package_name, '-c', 'android.intent.category.LAUNCHER', '1'],
                    capture_output=True,
                    timeout=10