Back to skill

Security audit

Hytale Server

Security checks for vulnerabilities and agentic risk

Overview

This looks like a legitimate local Hytale server helper, but it runs a user-provided downloader binary with local credentials without integrity checks or strong handling guidance.

Install only if you are comfortable running the Hytale downloader you place in ~/hytale_server. Verify the downloader's source or checksum if available, protect hytale-downloader-credentials.json with restrictive permissions such as 600, and keep credentials out of backups, logs, and source control. Review the script before use because update executes the downloader with your normal user privileges.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T08 · Insecure Dependencies

Warning
Location
hytale.sh:40
Finding
Downloader Executed Without Integrity or Authenticity Verification<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:10-13`; `hytale.sh:40-65` **Vulnerability Type**: Unverified third-party executable **Risk Level**: Medium ### Complete Code Snippet ```markdown 1. **Download the Hytale Downloader:** - Get the zip from: `https://downloader.hytale.com/hytale-downloader.zip` - Unzip it and place `hytale-downloader-linux-amd64` in `~/hytale_server/`. - Make it executable: `chmod +x ~/hytale_server/hytale-downloader-linux-amd64` ``` ```bash # Check if downloader exists in server dir; if not, check for the linux binary specifically if user unzipped it if [ ! -f "$DOWNLOADER" ]; then # Try to find the linux binary if the generic name isn't there if [ -f "$SERVER_DIR/hytale-downloader-linux-amd64" ]; then DOWNLOADER="$SERVER_DIR/hytale-downloader-linux-amd64" else echo "Error: Hytale Downloader not found in $SERVER_DIR." echo "Please download it from: $DOWNLOAD_URL" echo "Unzip it and place the binary (hytale-downloader-linux-amd64) in $SERVER_DIR" echo "Make sure to mark it executable: chmod +x $SERVER_DIR/hytale-downloader-linux-amd64" exit 1 fi fi echo "Running Hytale Downloader..." cd "$SERVER_DIR" # Use explicit credentials file if present CRED_ARG="" if [ -f "hytale-downloader-credentials.json" ]; then CRED_ARG="-credentials-path hytale-downloader-credentials.json" fi chmod +x "$DOWNLOADER" "$DOWNLOADER" -download-path "$SERVER_DIR" $CRED_ARG ``` ### Technical Analysis The skill instructs the user to download a third-party executable and place it in a user-writable server directory. During an update, the script executes any regular file found under either expected downloader name. It does not verify a cryptographic digest, vendor signature, file ownership, or expected permissions before execution. HTTPS protects the download while it is in transit but does not independently establish the integrity of a file after download or protec ...[truncated 1711 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Obtain an official SHA-256 digest or vendor signing key through an independently trusted channel. 2. Verify the downloader before every execution, for example with `sha256sum -c`, and terminate on any mismatch. 3. Prefer vendor signature verification over a hardcoded digest when an official signing mechanism is available. 4. Reject symbolic links and unexpected file types before execution. 5. Validate that the downloader is owned by the expected user and is not writable by group or other users. 6. Do not automatically make an unverified file executable. Perform verification first and only then apply the minimum required permissions. 7. Store credentials outside the downloader and server-content directory, restrict them to mode `0600`, and pass only the required credentials path. 8. Check and propagate the downloader's exit status so failed or incomplete updates are not treated as successful. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
hytale.sh:11
Finding
Imprecise Screen Session Matching Can Select or Report an Unintended Session<![CDATA[ ## Vulnerability Details **File Location**: `hytale.sh:11-13`, `hytale.sh:26-29`, `hytale.sh:67-71` **Vulnerability Type**: Ambiguous process and session identification **Risk Level**: Low ### Complete Code Snippet ```bash start) if screen -list | grep -q "$SCREEN_NAME"; then echo "Server is already running." ``` ```bash stop) if screen -list | grep -q "$SCREEN_NAME"; then echo "Stopping server..." screen -S "$SCREEN_NAME" -X stuff "stop^M" echo "Stop command sent." ``` ```bash status) if screen -list | grep -q "$SCREEN_NAME"; then PID=$(screen -list | grep "$SCREEN_NAME" | cut -d. -f1 | awk '{print $1}') echo "Server is ONLINE (PID: $PID)." else echo "Server is OFFLINE." fi ``` ### Technical Analysis The script checks for a running server with `grep -q "$SCREEN_NAME"`, where `SCREEN_NAME` is `hytale`. This is a substring search over the complete output of `screen -list`, not an exact comparison against a session named `hytale`. A session such as `hytale-test` or `not-hytale` can therefore satisfy the check. The status pipeline can also process multiple matching rows, producing incorrect or malformed PID output. The stop operation then uses the abbreviated selector `screen -S hytale`; depending on the available sessions and Screen's matching behavior, this can fail due to ambiguity or refer to a session other than the intended server session. No shell command injection is present because `SCREEN_NAME` is a fixed script constant. The issue is incorrect resource identification. ### Attack Path 1. A process running under the same account creates a Screen session whose name contains `hytale`, such as `hytale-test`. 2. The legitimate `hytale` server session is absent, or several similarly named sessions exist. 3. The user invokes `start`, `status`, or `stop`. 4. The substring search treats the similarly named session as the Hytale server. 5. `start` may decline to launch the server, `status` may report an unre ...[truncated 786 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Match the exact Screen session name rather than searching for an unrestricted substring. 2. Parse a session only when the listing contains an exact identifier matching a pattern such as `[0-9]+\.hytale[[:space:]]`. 3. Capture the complete `PID.session-name` identifier from the validated row. 4. Use that exact identifier for status and stop operations rather than the abbreviated name. 5. Reject the operation if zero or multiple exact matches are found. 6. Check the exit status of `screen -S ... -X stuff` before reporting that the stop command was sent. 7. Consider recording the exact session identifier or server PID in a protected runtime file and validating that it still belongs to the expected Java server process. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (6)

Credential Access

High
Category
Privilege Escalation
Content
- Java 21+ (Installed)
- Screen (Installed)
- Hytale Downloader (User must provide)
- Credentials (User must provide `hytale-downloader-credentials.json` in `~/hytale_server`)

## Setup
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- Java 21+ (Installed)
- Screen (Installed)
- Hytale Downloader (User must provide)
- Credentials (User must provide `hytale-downloader-credentials.json` in `~/hytale_server`)

## Setup
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- Java 21+ (Installed)
- Screen (Installed)
- Hytale Downloader (User must provide)
- Credentials (User must provide `hytale-downloader-credentials.json` in `~/hytale_server`)

## Setup
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- Java 21+ (Installed)
- Screen (Installed)
- Hytale Downloader (User must provide)
- Credentials (User must provide `hytale-downloader-credentials.json` in `~/hytale_server`)

## Setup
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill instructs users to place a credential file in a predictable local directory but provides no warning about the sensitivity of that file, required file permissions, or safe handling practices. This increases the risk of accidental exposure through overly broad filesystem permissions, backups, logs, or other local tooling that may access files in the home directory.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
The update path executes an external binary from the server directory after only checking for file existence and setting it executable. Because that binary is expected to be downloaded and placed manually, the script provides no integrity verification, trust validation, or explicit warning before execution, so a tampered or replaced downloader could run arbitrary code with the user's privileges and access local server files.

Static analysis

No suspicious patterns detected.