Back to skill

Security audit

Daum Trends Briefing

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Daum trends briefing script with an optional user-created cron and Telegram schedule; it has robustness caveats but no hidden or purpose-mismatched behavior.

Install only if you want Daum trend data fetched live and, if you run the cron command, hourly agent turns announced to Telegram. Consider adding redirect limits, response-size limits, and output sanitization before relying on it for automated announcements.

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

Warning
Location
scripts/briefing.mjs:6
Finding
Unrestricted Redirect Following and Unbounded HTTP Response Buffering<![CDATA[ ## Vulnerability Details **File Location**: `scripts/briefing.mjs`, lines 6–47 **Vulnerability Type**: Unrestricted redirects and resource exhaustion **Risk Level**: Medium ```js function fetchText(url, { timeoutMs = 15000 } = {}) { return new Promise((resolve, reject) => { const u = new URL(url); const req = https.request( { method: 'GET', hostname: u.hostname, path: u.pathname + u.search, headers: { 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123 Safari/537.36', accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'accept-language': 'ko-KR,ko;q=0.9,en-US;q=0.7,en;q=0.6' } }, (res) => { if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) { // follow redirect (handle relative Location) const nextUrl = new URL(res.headers.location, url).toString(); resolve(fetchText(nextUrl, { timeoutMs })); res.resume(); return; } if (!res.statusCode || res.statusCode < 200 || res.statusCode >= 300) { const code = res.statusCode; res.resume(); reject(new Error(`HTTP ${code} for ${url}`)); return; } res.setEncoding('utf8'); let data = ''; res.on('data', (c) => (data += c)); res.on('end', () => resolve(data)); } ); req.on('error', reject); req.setTimeout(timeoutMs, () => { req.destroy(new Error(`Timeout after ${timeoutMs}ms for ${url}`)); }); req.end(); }); } ``` ### Technical Analysis The HTTP helper follows every redirect recursively without a redirect counter, destination-host allowlist, protocol validation, or private-address restriction. Consequently, a redirected request is not constrained to the expected Daum domains. The helper also concate ...[truncated 1633 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Add a strict redirect limit, such as three to five hops. - Permit only the `https:` protocol and explicitly reject all other protocols. - Allowlist the expected destination hosts, such as `www.daum.net` and `search.daum.net`. - Resolve destination addresses and reject loopback, private, link-local, multicast, and other reserved ranges when arbitrary redirects are not required. - Enforce a maximum response size while processing chunks and destroy the request once the limit is exceeded. - Validate `Content-Length` before reading when it is present, while retaining the streaming limit because that header is not always trustworthy. - Apply an overall operation deadline across the entire redirect chain rather than resetting the effective time budget for every request. - Prefer an iterative redirect loop over recursive promise chaining so redirect state and cumulative limits are explicit. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/briefing.mjs:171
Finding
Remote Content Can Inject Additional Lines and Control Characters into Announced Output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/briefing.mjs`, lines 171–190 **Vulnerability Type**: Improper neutralization of externally sourced output **Risk Level**: Low ```js for (let i = 0; i < keywords.length; i++) { const kw = keywords[i]; const searchUrl = buildSearchUrl(kw); let title = 'Daum 검색 결과'; try { const searchHtml = await fetchText(searchUrl); const extracted = extractFirstTitleAndLinkFromSearch(searchHtml); if (extracted.title) title = extracted.title; } catch { // keep fallback } // Keep the link stable (search link), because result URLs can vary. lines.push(`${i + 1}. ${kw}: “${title}” ${searchUrl}`); } lines.push(`updatedAt: ${updatedAt}`); // Ensure exactly 12 lines process.stdout.write(lines.slice(0, 12).join('\n') + '\n'); ``` The externally sourced fields originate from the following parsing logic: ```js const updatedAtMatch = slice.match(/"updatedAt"\s*:\s*"([^"]+)"/); const updatedAt = updatedAtMatch?.[1]; const keywords = keywordsRaw .map((k) => k?.keyword) .filter((k) => typeof k === 'string' && k.trim().length > 0) .slice(0, 10); ``` ```js const title = decodeHtmlEntities(stripTags(m[2])).replace(/\s+/g, ' ').trim(); ``` ### Technical Analysis Keywords and `updatedAt` are extracted from remote HTML and inserted directly into stdout without removing newline characters or terminal control sequences. Titles receive whitespace normalization, but other externally sourced fields do not receive equivalent normalization. The expression `lines.slice(0, 12)` limits the number of JavaScript array elements, not the number of physical output lines. A keyword or timestamp containing carriage-return or newline characters can therefore produce more than the documented 12 lines. `SKILL.md` recommends announcing stdout to Telegram “as-is.” This turns malformed or attacker-influenced upstream content into externally delivered message ...[truncated 1366 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Normalize every remotely sourced field before interpolation, including keywords, titles, and `updatedAt`. - Replace CR, LF, Unicode line separators, and nonessential control characters with spaces. - Apply conservative per-field length limits to prevent oversized messages. - Validate `updatedAt` against the expected timestamp format instead of accepting arbitrary text. - Validate keywords against an explicit printable-character policy appropriate for Korean and English text. - Count physical output lines after final serialization and reject or replace any output that does not contain exactly 12 lines. - Escape content according to the Telegram parse mode if Markdown or HTML formatting is enabled by the announcement layer. - Consider prefixing every generated line with a fixed structure after sanitization so attacker-controlled text cannot visually impersonate metadata or ranking entries. ]]>
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (2)

Ae1

High
Category
analysis-evasion
Content
- Entry point: `scripts/briefing.mjs`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Session Persistence

Medium
Category
Rogue Agent
Content
In this OpenClaw setup, cron jobs typically run an **agent turn**. The agent can execute the Node script and then announce the stdout to Telegram.

Create a cron job with the CLI (recommended):

```bash
openclaw cron add \
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Static analysis

No suspicious patterns detected.