Back to skill

Security audit

Maven Smart System Ai (palantir integration)

Security checks for vulnerabilities and agentic risk

Overview

This skill is coherent with its tactical MSS purpose, but it handles sensitive credentials and can perform strike-related workflow changes with weak local safeguards.

Install only in an environment where the MSS endpoint is administratively controlled, credentials are short-lived and scoped, and server-side authorization enforces approval, deconfliction, and audit requirements. Treat the local .env file and command logs as sensitive, rotate any key used with this setup, and avoid using this skill on shared machines.

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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/mss_client.py:8
Finding
Unrestricted API endpoint permits API-key disclosure and transmission over insecure transport## Vulnerability Details **File Location**: `scripts/mss_client.py:8-45`; related configuration in `scripts/setup_env.py:5-19` **Vulnerability Type**: Unvalidated destination for authenticated network requests **Risk Level**: High ### Vulnerable Code ```python def get_client(): env_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), ".env") load_dotenv(env_path) api_key = os.environ.get("MSS_API_KEY") endpoint = os.environ.get("MSS_API_ENDPOINT") if not api_key or not endpoint: print("ERROR: MSS not configured. Please provide your API key to initialize.") sys.exit(1) headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json", "Accept": "application/json", } return endpoint, headers def api_get(path, params=None): endpoint, headers = get_client() resp = requests.get(f"{endpoint}{path}", headers=headers, params=params, timeout=15) resp.raise_for_status() return resp.json() def api_post(path, payload): endpoint, headers = get_client() resp = requests.post(f"{endpoint}{path}", headers=headers, json=payload, timeout=15) resp.raise_for_status() return resp.json() def api_patch(path, payload): endpoint, headers = get_client() resp = requests.patch(f"{endpoint}{path}", headers=headers, json=payload, timeout=15) resp.raise_for_status() return resp.json() ``` The endpoint is persisted without validation: ```python def save_env(api_key, endpoint): env_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), ".env") lines = [] if os.path.exists(env_path): with open(env_path, "r") as f: for line in f: if not line.startswith("MSS_API_KEY=") and not line.startswith("MSS_API_ENDPOINT="): lines.append(line) lines.append(f"MSS_API_KEY={api_k ...[truncated 2690 chars]
Remediation
## Remediation Suggestions - Require `https://` and reject plaintext HTTP. - Validate the parsed hostname against an administrator-controlled allowlist of authorized MSS domains. - Reject URLs containing user information, fragments, unexpected ports, loopback addresses, link-local addresses, and private destinations unless explicitly required by the deployment. - Normalize the endpoint with `urllib.parse` and construct paths safely rather than concatenating arbitrary strings. - Disable cross-origin redirects for authenticated calls, or verify that every redirect destination remains on the approved origin before forwarding the authorization header. - Prefer deployment-managed endpoint configuration rather than accepting an endpoint through ordinary conversational input. - Use narrowly scoped, short-lived API tokens and support immediate token revocation. - Consider certificate pinning or a deployment-specific trust store for high-sensitivity environments. - Clearly display the validated destination and require explicit confirmation before first transmitting a credential.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:13
Finding
API key is exposed through command-line arguments and weakly protected plaintext storage## Vulnerability Details **File Location**: `SKILL.md:13-17`; `scripts/setup_env.py:5-19` **Vulnerability Type**: Plaintext credential exposure **Risk Level**: High ### Vulnerable Code The Skill places the secret directly in a command-line argument: ```yaml - name: initialize_config description: Saves the Palantir MSS API key and endpoint to the local .env file during initial setup. command: "python3 ./scripts/setup_env.py --key {{api_key}} --endpoint {{endpoint}}" parameters: api_key: string endpoint: string ``` The setup script then writes it as plaintext without creating the file with restrictive permissions: ```python def save_env(api_key, endpoint): env_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), ".env") lines = [] if os.path.exists(env_path): with open(env_path, "r") as f: for line in f: if not line.startswith("MSS_API_KEY=") and not line.startswith("MSS_API_ENDPOINT="): lines.append(line) lines.append(f"MSS_API_KEY={api_key}\n") lines.append(f"MSS_API_ENDPOINT={endpoint}\n") with open(env_path, "w") as f: f.writelines(lines) ``` ### Technical Analysis Interpolating the API key into `--key {{api_key}}` exposes the secret in the process argument vector. Depending on the execution environment, command-line arguments can be recorded or observed through: - Process inspection utilities. - Agent or tool execution logs. - Shell history when the command is run manually. - Job-control and process-monitoring systems. - Crash reports and diagnostic telemetry. The script additionally stores the key in a project-level `.env` file. It uses ordinary `open(..., "w")` and does not enforce owner-only permissions. For a newly created file, the resulting permissions depend on the process umask and may allow other local users or group members to read it. For an existing file ...[truncated 1480 chars]
Remediation
## Remediation Suggestions - Never place secrets in command-line arguments. - Read the API key from protected standard input using `getpass.getpass()`, a dedicated inherited file descriptor, or a platform secret manager. - Prefer an operating-system credential store, workload identity, or short-lived token provider over a plaintext `.env` file. - If file storage is unavoidable, create the file atomically with owner-only mode `0600`. - Verify that the destination is a regular file owned by the expected user and reject symbolic links. - Write to a securely created temporary file in the same directory, apply `0600`, flush and synchronize it, then atomically replace `.env`. - Explicitly correct permissions on existing configuration files. - Add `.env` to source-control exclusions and prevent it from entering backups, artifacts, and diagnostic bundles unless those systems provide equivalent secret protection. - Rotate any API key previously initialized through this command, because it may already exist in process or execution logs.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/assign_asset.py:5
Finding
Strike-related state changes rely only on conversational confirmation and can be invoked directly## Vulnerability Details **File Location**: `scripts/assign_asset.py:5-10`; `scripts/update_status.py:8-15`; related policy in `SKILL.md:131-135` **Vulnerability Type**: Missing enforcement for security-critical operations **Risk Level**: High ### Vulnerable Code Asset assignment is performed immediately when the script is invoked: ```python def assign_asset(target_id, asset_id): data = api_post(f"/targets/{target_id}/assign", payload={"asset_id": asset_id}) print(f"Asset {asset_id} assigned to target {target_id}") print(f" Mission ID: {data['mission_id']}") print(f" Status: {data['status']}") print(f" ETA: {data['eta_minutes']} minutes") ``` Target approval and other status changes are likewise performed directly: ```python def update_status(target_id, new_status): status_lower = new_status.lower() if status_lower not in VALID_STATUSES: print(f"ERROR: Invalid status '{new_status}'. Valid: {', '.join(VALID_STATUSES)}") return data = api_patch(f"/targets/{target_id}/status", payload={"status": status_lower}) print(f"Target {target_id}: {data['previous_status']} -> {status_lower}") ``` The only confirmation requirement is an instruction to the agent: ```markdown 3. **Safety Protocol (Critical):** Before executing ANY of the following actions, you MUST request explicit text confirmation from the operator: - Changing a target status to `approved` - Assigning a strike asset to a target - Any action that moves a target closer to engagement Format: "Confirm [action] for target [ID]: Y/N" ``` ### Technical Analysis A natural-language instruction is not an enforceable authorization boundary. Neither script requires a confirmation token, authenticated approval record, two-person authorization, recent risk assessment, or deconfliction result. Anyone or anything capable of invoking the scripts can bypass the documented chat workf ...[truncated 1953 chars]
Remediation
## Remediation Suggestions - Enforce authorization on the MSS server; do not rely on agent prose or client-side prompts. - Require a short-lived, server-issued approval token bound to the exact target, action, asset, operator identity, and expiration time. - Require the mutation endpoint to verify completed CDE and deconfliction checks and reject stale assessments. - Implement explicit state-transition rules server-side, such as preventing direct transitions from `detected` to `engaged`. - Use role-based access control and separate read-only, workflow-management, approval, and assignment privileges. - For high-consequence actions, require two-person authorization or an equivalent signed approval workflow. - Add idempotency keys and a final server-returned action summary before commitment. - Record tamper-resistant audit events containing the authenticated operator, target, asset, assessment identifiers, confirmation, timestamp, and request origin. - Modify the scripts so that they cannot perform sensitive mutations without the server-issued authorization artifact. - Keep the conversational confirmation as a usability safeguard, but never treat it as the sole security control.

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding
Dependencies are installed from open-ended version ranges without integrity pinning## Vulnerability Details **File Location**: `requirements.txt:1-2` **Vulnerability Type**: Unpinned third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```text requests>=2.28.0 python-dotenv>=1.0.0 ``` ### Technical Analysis Both dependencies use unrestricted lower-bound constraints. A future installation may therefore resolve to any later release available from the configured package index. The project provides no lock file, package hashes, upper bounds, or verified artifact source. The package names are legitimate and the reviewed files do not establish that a currently selected release is malicious. The confirmed weakness is the absence of reproducible and integrity-verified dependency resolution. If an upstream release or configured package index is compromised, installations can automatically consume the changed package without a source-code change in this project. These dependencies execute within the same Python process as the Skill. They can access the MSS API key, endpoint, request contents, filesystem permissions, and network privileges of that process. ### Attack Path 1. An attacker compromises an upstream release channel, package-index account, mirror, or build environment used for dependency resolution. 2. A malicious or compromised later release still satisfies the `>=` constraint. 3. A fresh environment installs that release because no exact version or hash is required. 4. The package code executes when `requests` or `dotenv` is imported. 5. Malicious initialization or runtime logic reads `.env`, captures the bearer key and tactical data, modifies API behavior, or performs other actions available to the process. ### Impact Assessment A compromised dependency would execute with the full privileges of the Skill process. It could read the plaintext API key, intercept all MSS requests and responses, alter strike-related operations, access files available to the current user, an ...[truncated 217 chars]
Remediation
## Remediation Suggestions - Pin reviewed dependency versions exactly in a generated lock file. - Require cryptographic hashes for every wheel or source distribution, such as with `pip --require-hashes`. - Resolve and pin transitive dependencies as well as direct dependencies. - Install only from an approved package index or internal artifact repository. - Prefer verified wheels and prohibit unexpected source builds in production. - Use automated vulnerability and provenance scanning before updating locked versions. - Review dependency updates deliberately and test them in an isolated environment before deployment. - Generate and retain a software bill of materials for each release.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (34)

Tainted flow: 'headers' from os.environ.get (line 19, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Content
def api_get(path, params=None):
    endpoint, headers = get_client()
    resp = requests.get(f"{endpoint}{path}", headers=headers, params=params, timeout=15)
    resp.raise_for_status()
    return resp.json()
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tainted flow: 'headers' from os.environ.get (line 19, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Content
def api_post(path, payload):
    endpoint, headers = get_client()
    resp = requests.post(f"{endpoint}{path}", headers=headers, json=payload, timeout=15)
    resp.raise_for_status()
    return resp.json()
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tainted flow: 'headers' from os.environ.get (line 19, credential/environment) → requests.patch (network output)

Critical
Category
Data Flow
Content
def api_patch(path, payload):
    endpoint, headers = get_client()
    resp = requests.patch(f"{endpoint}{path}", headers=headers, json=payload, timeout=15)
    resp.raise_for_status()
    return resp.json()
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Although most TP4 items are weak, this one correctly highlights an undeclared sensitive behavior: the skill asks for credentials and writes them to a local .env file, which is not clearly surfaced in the top-level description. Hidden or underemphasized credential storage behavior can surprise users, weaken informed consent, and increase the risk of secrets being left on disk where other local processes or users may access them.

Credential Access

High
Category
Privilege Escalation
Content
tools:
  - name: initialize_config
    description: Saves the Palantir MSS API key and endpoint to the local .env file during initial setup.
    command: "python3 ./scripts/setup_env.py --key {{api_key}} --endpoint {{endpoint}}"
    parameters:
      api_key: string
Confidence
97% confidence
Finding
The skill explicitly handles a high-value MSS API key and writes it to a local .env file, creating a clear credential-access and credential-storage risk. Plaintext local storage can be exposed through filesystem reads, backups, logs, multi-user systems, or later tooling, and in this operational context stolen credentials could expose sensitive targeting, intelligence, and strike-planning data or enable unauthorized actions.

Credential Access

High
Category
Privilege Escalation
Content
def get_client():
    env_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), ".env")
    load_dotenv(env_path)

    api_key = os.environ.get("MSS_API_KEY")
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
def save_env(api_key, endpoint):
    env_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), ".env")

    lines = []
    if os.path.exists(env_path):
Confidence
84% confidence
Finding
The code explicitly targets a .env file for storing an MSS API key, which is a credential-handling pattern that can expose secrets if the file is committed, copied, or read by unauthorized users. In a skill tied to a defense/intelligence workflow, compromise of this token could enable unauthorized access to sensitive operational systems or data accessible through the MSS API.

Lp3

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding
The skill exposes capabilities that can read environment variables, write local files, and perform network/API access, yet it declares no explicit tool scope or permissions boundary. That omission increases the chance of over-privileged execution and makes it harder for reviewers or the runtime to constrain sensitive operations such as credential handling and external API calls.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The initialization flow instructs users to paste an API key and then persists it locally in a .env file without any warning about plaintext storage, file permissions, rotation, or shared-host risk. In a high-sensitivity military/intelligence context, that makes accidental credential exposure more dangerous because compromised MSS credentials could enable unauthorized access to operational data and actions.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The script sends a target identifier and deconfliction radius to a backend endpoint with no user-facing notice, confirmation, or explanation of what sensitive operational data is being transmitted. In the context of a military targeting and strike-support workflow, these parameters can reveal active targeting activity and operational intent, so silent transmission increases the risk of unintended disclosure, misuse, or operator error.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
This code makes an API request to retrieve operational strike, damage, and collateral-assessment data, which is sensitive system data. Although the script prints the results after retrieval, there is no prior user-facing warning, confirmation, comment, or docstring disclosing that it will contact a remote service and access potentially sensitive assessment data.

Missing User Warnings

Medium
Confidence
85% confidence
Finding
The script performs an API call to retrieve detailed asset and munitions information, which may be sensitive, but the code provides no comment, docstring, or user-facing disclosure before doing so. For code files, network calls that transmit or access potentially sensitive system data should include some visible warning unless already clearly disclosed.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The helper functions perform outbound GET, POST, and PATCH requests using a bearer token loaded from environment variables, but there is no confirmation prompt, logging, comment, or docstring warning that data will be sent to an external endpoint. Because these functions can transmit user or system data over the network, the file lacks visible disclosure for a safety-relevant operation.

External Transmission

Medium
Category
Data Exfiltration
Content
def api_post(path, payload):
    endpoint, headers = get_client()
    resp = requests.post(f"{endpoint}{path}", headers=headers, json=payload, timeout=15)
    resp.raise_for_status()
    return resp.json()
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The script performs a sensitive pattern-of-life intelligence query and immediately displays the results without any warning, consent prompt, or disclosure about the sensitivity of the data being accessed. In the context of a tactical intelligence integration for Palantir Maven, this increases the risk of unauthorized or casual access to highly sensitive surveillance-derived information and makes misuse less visible to the operator.

Static analysis

No suspicious patterns detected.