Back to skill

Security audit

Hospitable Ops

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its Hospitable operations purpose, but its helper scripts handle a live Hospitable token in ways that can send it to an overridden host and can perform broader writes than the documented safety limits.

Review this skill before installing. Use only with a tightly scoped Hospitable token, do not set HOSPITABLE_BASE_URL unless you fully trust the destination, and treat hospitable-write-probe.js as a powerful raw API tool rather than a safety-enforced calendar-only helper.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/hospitable-read.js:3
Finding

Bearer Token Can Be Exfiltrated Through an Unrestricted Base URL

Content
View full analysis

Vulnerability Details

File Location: scripts/hospitable-read.js, lines 3-4 and 27-29
Vulnerability Type: Unrestricted credential forwarding
Risk Level: High

Vulnerable Code

js
const token = process.env.HOSPITABLE_TOKEN;
const base = process.env.HOSPITABLE_BASE_URL || 'https://public.api.hospitable.com/v2/';
js
function requestJson(path) {
  return new Promise((resolve, reject) => {
    const url = new URL(path, base);
    const req = https.request(url, { method: 'GET', headers: { Authorization: `Bearer ${token}`, Accept: 'application/json' } }, (res) => {

The same unsafe pattern also occurs in scripts/hospitable-write-probe.js, lines 3-4 and 13-19:

js
const token = process.env.HOSPITABLE_TOKEN;
const base = process.env.HOSPITABLE_BASE_URL || 'https://public.api.hospitable.com/v2/';
js
const url = new URL(pathname, base);
const req = https.request(url, {
  method,
  headers: {
    Authorization: `Bearer ${token}`,
    Accept: 'application/json',
    ...(body ? { 'Content-Type': 'application/json' } : {})
  }

Technical Analysis

Both scripts allow the API base URL to be overridden through HOSPITABLE_BASE_URL, but neither verifies that the resulting URL belongs to the official Hospitable API origin. The scripts then unconditionally attach HOSPITABLE_TOKEN as an HTTP bearer credential.

Because Node.js https.request() accepts any HTTPS destination, an attacker who can influence the process environment can redirect authenticated requests to an attacker-controlled server. HTTPS only protects the connection in transit; it does not establish that the destination is authorized to receive the credential.

Attack Path

  1. An attacker gains influence over the environment used to invoke either script, such as through a poisoned environment file, CI configuration, process launcher, or manipulated automation configuration.
  2. The attacke ...[truncated 985 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove the configurable base URL from production operation when it is unnecessary.
  • If an override is required for testing, parse and validate it before constructing any request:
    • Require the https: protocol.
    • Require the exact origin https://public.api.hospitable.com.
    • Reject embedded credentials, unexpected ports, lookalike hostnames, and subdomains.
  • Validate the final resolved URL immediately before attaching the authorization header.
  • Never forward the bearer token following a cross-origin redirect; preferably disable redirects entirely.
  • Separate production and testing credentials, and ensure test endpoints can only receive restricted test tokens.
  • Rotate the bearer token if either script has previously run with an untrusted HOSPITABLE_BASE_URL.
  • Apply the same correction to both hospitable-read.js and hospitable-write-probe.js.

Example origin enforcement:

js
const OFFICIAL_ORIGIN = 'https://public.api.hospitable.com';
const baseUrl = new URL(
  process.env.HOSPITABLE_BASE_URL ||
  `${OFFICIAL_ORIGIN}/v2/`
);

if (baseUrl.protocol !== 'https:' || baseUrl.origin !== OFFICIAL_ORIGIN) {
  throw new Error('Untrusted Hospitable API origin');
}

const url = new URL(path, baseUrl);
if (url.origin !== OFFICIAL_ORIGIN) {
  throw new Error('Refusing to forward credentials to another origin');
}

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/hospitable-write-probe.js:8
Finding

Unrestricted Authenticated Write Probe Bypasses the Declared Safety Boundary

Content
View full analysis

Vulnerability Details

File Location: scripts/hospitable-write-probe.js, lines 8-10, 12-19, and 28-29
Vulnerability Type: Missing authorization and operation allowlisting
Risk Level: Medium

Vulnerable Code

js
const args = process.argv.slice(2);
const method = args[0] || 'OPTIONS';
const pathArg = args[1] || 'properties';
const body = args[2] || null;
function request(pathname, method, body) {
  return new Promise((resolve, reject) => {
    const url = new URL(pathname, base);
    const req = https.request(url, {
      method,
      headers: {
        Authorization: `Bearer ${token}`,
        Accept: 'application/json',
        ...(body ? { 'Content-Type': 'application/json' } : {})
      }
    }, (res) => {
js
    req.on('error', reject);
    if (body) req.write(body);
    req.end();

Technical Analysis

The script accepts the HTTP method, API path, and raw request body directly from command-line arguments and sends them with the production bearer token. It performs no local authorization checks or schema validation.

This conflicts with the safety policy in SKILL.md, which limits direct write activity to controlled, non-price calendar operations and reserves price, currency, and money-related changes for human handling. The implementation does not enforce those restrictions. In particular, it lacks:

  • An HTTP method allowlist.
  • A calendar endpoint allowlist.
  • Property UUID and path validation.
  • JSON parsing and schema validation.
  • Rejection of price, currency, or other money-related fields.
  • Rejection of unknown fields.
  • A dry-run or explicit confirmation mechanism.
  • Validation that the target date is a low-risk future date.

Documentation-only safety rules are insufficient when an agent or user can invoke a generic authenticated HTTP client. Whether a particular malicious request succeeds depends on the endpoints exposed by Hospitable ...[truncated 1333 chars]

Remediation
View remediation

Remediation Suggestions

Replace the generic request facility with a narrowly scoped calendar-operation interface:

  • Permit only PUT.
  • Require paths to match an exact structure such as properties/<validated-UUID>/calendar.
  • Parse the body as JSON before transmission.
  • Require a top-level dates array.
  • Allow only the fields date, available, closed_for_checkin, and closed_for_checkout.
  • Validate dates strictly as real YYYY-MM-DD calendar dates and enforce an approved future window.
  • Validate boolean fields as booleans.
  • Reject unknown fields, including price, currency, rate, fee, amount, or discount data.
  • Limit the number of dates per operation.
  • Add a dry-run mode that prints a redacted request summary.
  • Require explicit confirmation for live writes or use a separate, narrowly scoped token.
  • Log the target property, dates, and operation type without recording credentials or sensitive reservation data.
  • Perform delayed readback verification after accepted writes.
  • Rely on server-side token scopes as an additional control rather than as the only safety boundary.

A safer interface should accept structured operation names such as block, unblock, or restrict-checkin, rather than arbitrary methods, paths, and raw request bodies.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (3)

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
85% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

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

md
- MCP has been removed from the current Hospitable operating path; do not route or describe Hospitable work through MCP.
- Use persistent config or local scripts; avoid session-only ad hoc setup when building repeatable workflows.
- Default to non-price actions only. Price, currency, and money-related changes must be discussed first and then changed manually by the human.
- Assume write effects may be asynchronous. Do not judge failure from an immediate readback alone.
- In this workspace, do not rely on OpenClaw runtime inheriting shell env automatically; prefer script-level loading from `/Users/admin-ai/.openclaw/workspace-qiang/.env.local` for repeatable Hospitable execution.
- `HOSPITABLE_TOKEN` must contain the token body only; never include a leading `Bearer ` prefix in the env value.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- after enabling script-level env loading, `node scripts/hospitable-read.js properties --per-page 1` returned `statusCode: 200`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- after enabling script-level env loading, `node scripts/hospitable-read.js properties --per-page 1` returned `statusCode: 200`