Back to skill

Security audit

dalongxia-auth

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed social-platform client, but it handles credentials and public/private social actions with weak transport, storage, and telemetry controls.

Review carefully before installing. Use only on a machine where plaintext local session files are acceptable, do not enter real credentials through the HTTP raw-IP enrollment path, avoid custom apiEndpoint values unless you control the server, and assume posts, comments, likes, follows, and DMs may be performed on your external account when invoked.

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

other

Warning
Location
index.js:81
Finding

Persistent host fingerprint and AI model metadata transmitted to remote API

Content
View full analysis

Vulnerability Details

File Location: index.js:81-106
Vulnerability Type: Undisclosed device fingerprinting and metadata transmission
Risk Level: Medium

js
function generateSkillId() {
  const hostname = require('os').hostname();
  const username = require('os').userInfo().username;
  const hash = crypto
    .createHash('md5')
    .update(`${hostname}-${username}-dalongxia`)
    .digest('hex')
    .substring(0, 16);
  return `claw-${hash}`;
}

async function apiRequest(endpoint, method = 'GET', body = null, useAuth = false) {
  const config = loadConfig();
  const session = useAuth ? loadSession() : null;

  const url = `${config.apiEndpoint}${endpoint}`;
  const timestamp = Date.now().toString();
  const skillId = generateSkillId();

  const headers = {
    'Content-Type': 'application/json',
    'X-Skill-Id': skillId,
    'X-Skill-Timestamp': timestamp,
    'X-AI-Model': process.env.OPENCLAW_MODEL || 'unknown'
  };

Technical Analysis

Every request made through apiRequest() derives a stable identifier from the operating-system hostname and username. The identifier is sent to the configured server in the X-Skill-Id header, together with the value of the OPENCLAW_MODEL environment variable.

Hashing does not make this data anonymous. Hostnames and usernames commonly have low entropy, allowing likely combinations to be guessed and compared against the truncated MD5 value. The stable identifier also enables remote correlation of activity across commands, accounts, and sessions.

This behavior is not required to perform the declared social-platform functions. If an installation identifier is needed, a random identifier would provide the same functional capability without reading local OS identity attributes.

Attack Path

  1. A user invokes any command implemented through index.js that calls apiRequest().
  2. generateSkillId() reads the local hostname and ...[truncated 770 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not read the hostname or operating-system username for client identification.
  • Generate an installation identifier with crypto.randomUUID() or cryptographically secure random bytes.
  • Store that identifier locally with restrictive file permissions.
  • Transmit AI model metadata only when required and after explicit disclosure or consent.
  • Document all telemetry, its purpose, retention period, and destination.
  • Provide a configuration option to disable nonessential telemetry.

T09 · Insecure Skill Coding Practices

Error
Location
index.js:94
Finding

Authentication credentials can be transmitted to arbitrary or plaintext endpoints

Content
View full analysis

Vulnerability Details

File Location: index.js:94-124, index.js:499-518, skill.js:17-19, skill.js:39-60, skill.json:7-16
Vulnerability Type: Unrestricted credential destination and insecure transport configuration
Risk Level: High

js
async function apiRequest(endpoint, method = 'GET', body = null, useAuth = false) {
  const config = loadConfig();
  const session = useAuth ? loadSession() : null;

  const url = `${config.apiEndpoint}${endpoint}`;
  const timestamp = Date.now().toString();
  const skillId = generateSkillId();

  const headers = {
    'Content-Type': 'application/json',
    'X-Skill-Id': skillId,
    'X-Skill-Timestamp': timestamp,
    'X-AI-Model': process.env.OPENCLAW_MODEL || 'unknown'
  };

  if (useAuth || body !== null) {
    headers['X-Skill-Signature'] = generateSignature(body || {}, timestamp, config.apiKey);
  }

  if (session?.token) {
    headers['Authorization'] = `Bearer ${session.token}`;
  }

  const fetch = (await import('node-fetch')).default;
  const response = await fetch(url, {
    method,
    headers,
    body: body ? JSON.stringify(body) : undefined
  });
}
js
const [key, ...valueParts] = args;
const value = valueParts.join(' ');

const config = loadConfig();
config[key] = value;
saveConfig(config);
js
this.apiEndpoint = config.apiEndpoint || 'https://dalongxia.club';
this.apiKey = config.apiKey;

async signedRequest(method, endpoint, data = {}) {
  const { signature, timestamp } = this.generateSignature(data);

  const headers = {
    'Content-Type': 'application/json',
    'X-Skill-Id': this.skillId,
    'X-Skill-Signature': signature,
    'X-Skill-Timestamp': timestamp
  };

  if (this.session.token) {
    headers['Authorization'] = `Bearer ${this.session.token}`;
  }

  const response = await axios({
    method,
    url: `${this.apiEndpoint}${endpoint}`,
    data,
    
...[truncated 2443 chars]
Remediation
View remediation

Remediation Suggestions

  • Parse configured endpoints with the standard URL API.
  • Require the https: scheme for every non-loopback production endpoint.
  • Restrict production traffic to an explicit allowlist such as dalongxia.club.
  • Never attach authorization or signature headers when the destination origin differs from the trusted origin.
  • Disable cross-origin redirects for authenticated requests, or manually validate every redirect target.
  • Reject unsupported configuration keys rather than assigning arbitrary properties.
  • Replace the manifest's plaintext default with the verified HTTPS production endpoint.
  • Warn users and require explicit confirmation before allowing a custom development endpoint.
  • Rotate any bearer tokens that may have been sent to an untrusted endpoint.

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:18
Finding

API keys and bearer tokens are stored without explicit restrictive permissions

Content
View full analysis

Vulnerability Details

File Location: index.js:18-24, index.js:45-62, skill.js:22-24, skill.js:70-86
Vulnerability Type: Insecure local credential storage
Risk Level: Medium

js
const CONFIG_DIR = path.join(process.env.HOME || process.env.USERPROFILE, '.dalongxia');
const SESSION_FILE = path.join(CONFIG_DIR, 'session.json');
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');

if (!fs.existsSync(CONFIG_DIR)) {
  fs.mkdirSync(CONFIG_DIR, { recursive: true });
}

function saveConfig(config) {
  fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
}

function saveSession(session) {
  fs.writeFileSync(SESSION_FILE, JSON.stringify(session, null, 2));
}
js
this.storagePath = path.join(process.env.HOME || '.', '.dalongxia-session.json');
this.session = this.loadSession();

loadSession() {
  try {
    if (fs.existsSync(this.storagePath)) {
      return JSON.parse(fs.readFileSync(this.storagePath, 'utf8'));
    }
  } catch (e) {
    console.error('Session loading failed:', e.message);
  }
  return {};
}

saveSession() {
  try {
    fs.writeFileSync(this.storagePath, JSON.stringify(this.session, null, 2));
  } catch (e) {
    console.error('Session saving failed:', e.message);
  }
}

Technical Analysis

API keys and bearer-session tokens are written as plaintext JSON. The directory and files are created without explicit mode options, so their effective permissions depend on the process umask and surrounding environment.

On shared systems, containers with mounted home directories, or hosts using permissive umasks, another local user or process may be able to read the credentials. Two different session locations are used by the two implementations, increasing the number of secret-bearing files that must be protected and removed.

Attack Path

  1. The Skill saves configuration or a successful login session.
  2. The host's umas ...[truncated 709 chars]
Remediation
View remediation

Remediation Suggestions

  • Create the credential directory with mode 0700.
  • Create secret-bearing files with mode 0600.
  • Verify and repair permissions when loading existing files.
  • Use atomic writes through a restricted temporary file followed by a rename.
  • Consolidate session storage into one documented location.
  • Prefer an OpenClaw credential facility, operating-system keychain, or other protected secret store.
  • Avoid storing more user information than is required to resume the session.
  • Delete all session copies during logout and rotate tokens if local disclosure is suspected.

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:27
Finding

Hardcoded fallback API key and secret disclosure through configuration output

Content
View full analysis

Vulnerability Details

File Location: index.js:27-30, index.js:499-518
Vulnerability Type: Hardcoded credential and sensitive output exposure
Risk Level: Medium

js
const DEFAULT_CONFIG = {
  apiEndpoint: 'https://dalongxia.club',
  apiKey: 'dev-key-change-in-production'
};
js
async config(args) {
  if (args.length === 0) {
    const config = loadConfig();
    return {
      type: 'info',
      message: `Current configuration:
API endpoint: ${config.apiEndpoint}
API key: ${config.apiKey.substring(0, 10)}...`
    };
  }

  const [key, ...valueParts] = args;
  const value = valueParts.join(' ');

  const config = loadConfig();
  config[key] = value;
  saveConfig(config);

  return {
    type: 'success',
    message: `Configuration updated: ${key} = ${value}`
  };
}

Technical Analysis

The code provides a shared development API key when no user configuration exists, even though the manifest describes the API key as required. If the server accepts this key, every unconfigured installation shares the same signing secret and cannot provide meaningful client authentication.

The configuration display reveals the first ten characters of the configured key. More critically, updating apiKey places the full supplied value into the success response. That response may be retained in terminal history, agent transcripts, diagnostic logs, or monitoring systems.

The snippet above renders the existing localized output text in English while preserving the relevant interpolation and control flow from the audited source.

Attack Path

  1. The Skill runs without a configured API key and silently uses the shared fallback key; or a user supplies a real key through the config command.
  2. If the fallback is accepted, another party who knows the packaged value can generate equivalent HMAC signatures.
  3. If the configuration command is used, the full API key is echoed ...[truncated 607 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove the hardcoded fallback API key.
  • Fail closed with a clear error when the required key is absent.
  • Provision keys through a protected credential store rather than command arguments.
  • Never print any portion of an API key unless there is a documented operational need.
  • Do not echo configuration values for secret fields after updates.
  • Maintain an explicit list of sensitive configuration keys and consistently redact them.
  • Rotate the packaged fallback key and any user keys that may have appeared in logs.
  • Ensure server-side keys are unique, scoped, revocable, and subject to expiration.

T09 · Insecure Skill Coding Practices

Warning
Location
README.md:28
Finding

Documentation directs API-key enrollment through an unauthenticated plaintext HTTP service

Content
View full analysis

Vulnerability Details

File Location: README.md:28-31
Vulnerability Type: Plaintext transmission of registration and credential data
Risk Level: Medium

text
Obtain an API key:
1. Visit http://43.99.26.111:3000
2. Register an account and open the settings page.
3. Generate an OpenClaw Skill API key.

Technical Analysis

The setup instructions direct users to a bare IP address over unencrypted HTTP to register and generate an API key. HTTP does not provide transport confidentiality, integrity, or authenticated server identity.

The address also differs from the documented HTTPS production domain. Users therefore cannot reliably verify that the enrollment service belongs to the same operator. A network-positioned attacker can observe submitted information, alter returned content, capture cookies or keys, or replace the page with malicious instructions.

The snippet above is an English rendering of the audited setup instructions and preserves the exact network destination.

Attack Path

  1. A user follows the README and opens the plaintext HTTP enrollment address.
  2. A network attacker intercepts or modifies the connection.
  3. The user submits registration information or authenticates to the service.
  4. The attacker captures session material or modifies the settings page.
  5. When the API key is generated or displayed, the attacker obtains it.
  6. The captured credential is reused to sign requests or impersonate the user within its server-side scope.

Impact Assessment

The exposure may compromise registration data, web session cookies, or generated API keys. An attacker obtaining the key can exercise whatever signing privileges the service grants to that key. The issue affects account confidentiality and integrity but does not directly grant privileges on the local operating system.

Remediation
View remediation

Remediation Suggestions

  • Replace the plaintext IP address with a verified HTTPS URL under the documented service domain.
  • Use a valid publicly trusted TLS certificate.
  • Redirect HTTP to HTTPS without accepting credentials over the initial plaintext connection.
  • Enable HSTS on the enrollment domain.
  • Clearly document the authorized enrollment origin and expected certificate identity.
  • Revoke and rotate credentials that may have been provisioned through the plaintext endpoint.
  • Avoid exposing API keys directly in browser pages where a safer one-time provisioning mechanism is available.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (15)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The description claims 'AI self-service registration, human read-only,' yet the command list includes write-capable actions like login/register and post. This is a strong deception signal because it can cause humans, reviewers, or automated governance systems to underestimate the skill's ability to create accounts or publish content on a user's behalf.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README instructs users to place an API key in a local config file and to obtain it via an HTTP URL to a raw IP address, but it does not warn users to treat the key as a secret, avoid sharing or committing the config, or rotate it if exposed. This increases the risk of credential leakage and account misuse, especially because the skill enables authenticated posting and profile actions against a social platform.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill documentation is presented entirely in Chinese and gives no indication that users may choose another language or locale. The policy requires avoiding forced language constraints unless the skill offers user choice or clearly documents a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly advertises state-changing actions such as posting, commenting, liking, following, direct messaging, publishing skills, and purchasing skills, but provides no warning, consent flow, or confirmation guidance for these operations. In an agent context, this can lead to unintended social actions, spam, purchases, or disclosure through private messages if the agent executes commands on a user's behalf without clear user awareness.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The top-level documentation frames the skill primarily as an authentication suite, which implies identity/registration functionality. In practice, the module also performs a wide range of social-network operations against remote APIs, so the documentation materially understates and mischaracterizes the skill's behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

User-visible strings throughout the skill are hard-coded in Chinese, and timeline formatting explicitly uses toLocaleString('zh-CN'). This imposes a specific language/locale without opt-in, which violates the language-choice policy for natural-language behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill stores session data, including a bearer token, in plaintext on disk under the user’s home directory without warning or protection. If another local user, malware, backup process, or a later-compromised tool reads this file, the token can be reused to impersonate the user against the remote service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated skill ID is derived from the hostname and local username, then transmitted in request headers to a remote endpoint. This leaks stable host/user metadata that can identify or correlate a machine and account across requests, which is especially sensitive in an agent skill that also performs account registration and authenticated actions.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · index.js (reported line 94)May include surrounding context.

js
}

// 发起API请求
async function apiRequest(endpoint, method = 'GET', body = null, useAuth = false) {
  const config = loadConfig();
  const session = useAuth ? loadSession() : null;

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The top-level documentation identifies the skill as "dalongxia-auth" and "身份验证" (authentication), which implies a login/identity function. However, the documented and implemented behavior includes posting content, browsing timelines, exploring posts, and reading profiles, which goes materially beyond authentication and contradicts the claimed focus.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest presents the skill as an authentication suite, but it also exposes social-platform capabilities such as posting content and reading timelines. This mismatch can mislead reviewers, users, or higher-level policy controls into granting trust or permissions inappropriate for a broader social-action skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description states "AI自助注册,人类只读" (AI self-service registration, humans read-only), which is a natural-language restriction favoring one class of user without any opt-in, choice, or justification. This is a policy-level behavioral constraint expressed in the manifest text and applies regardless of implementation details.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The README explicitly advertises '自动登录:本地保存 session' but does not warn users that authentication session data is stored locally or advise them to protect or clear it on shared systems. This can lead to unintended account access if the local machine, home directory, or backup contents are exposed, though the issue is documentation and user-awareness related rather than an active exploit in the README itself.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The skill saves configuration values to a file in the user's home directory, creating persistent local state. Although the command returns a success message after writing, there is no advance disclosure in the help text or command description that using config will modify files on disk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code formats timestamps using toLocaleString('zh-CN', ...), which forces a specific locale for all users. Under the policy, locale-specific behavior should be optional or clearly justified, and this file does not provide an opt-in or explanation for the restriction.

Content

No source excerpt is available for this finding.