Back to skill

Security audit

Last30days

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real recent-research skill, but it needs Review because project-local configuration can redirect Xiaohongshu network requests to arbitrary internal or external URLs.

Install only if you are comfortable with a research tool sending your topics and prompts to AISA and public source APIs. Avoid using --search=xhs from untrusted repositories, and do not rely on project-local .claude/last30days.env for XIAOHONGSHU_API_BASE unless you personally control and trust the destination. Prefer setting sensitive keys and service endpoints in your own environment or user-owned config.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/lib/env.py:246
Finding

Project-Controlled Xiaohongshu Endpoint Enables Server-Side Request Forgery

Content
View full analysis
Path | None: """Find per-project .env by walking up from cwd. Searches for .claude/last30days.env in each parent directory, stopping at the user's home directory or filesystem root. """ cwd = Path.cwd() for parent in [cwd, *cwd.parents]: candidate = parent / '.claude' / 'last30days.env' if candidate.exists(): return candidate # Stop at filesystem root or home if parent == Path.home() or parent == parent.parent: break return None ``` The project file can define `XIAOHONGSHU_API_BASE`, overriding the default endpoint: ```python project_env_path = _find_project_env() project_env = load_env_file(project_env_path) if project_env_path else {} # Merge: project overrides global merged_env = {**file_env, **project_env} keys = [ ('AISA_MODEL', None), ('XIAOHONGSHU_API_BASE', None), ('LAST30DAYS_REASONING_PROVIDER', 'auto'), ('LAST30DAYS_PLANNER_MODEL', None), ('LAST30DAYS_RERANK_MODEL', None), ('LAST30DAYS_FUN_MODEL', None), ('LAST30DAYS_X_BACKEND', None), ('SETUP_COMPLETE', None), ('INCLUDE_SOURCES', None), ('LAST30DAYS_YOUTUBE_TRANSCRIPTS', None), ('LAST30DAYS_REDDIT_COMMENTS', None), ] for key, default in keys: config[key] = os.environ.get(key) or merged_env.get(key, default) ``` That value is used directly to construct outbound requests without validating the scheme, hostname, port, resolved IP address, or redirect destination: ```python def get_xiaohongshu_api_base(conf ...[truncated 5322 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (78)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose describes a substantive recent-information research capability spanning Reddit, X, YouTube, TikTok, Instagram, Hacker News, Polymarket, GitHub, and web search. The actual code chunk does none of that. It only checks for a compatible Python runtime and reports its path. While runtime selection could be a supporting utility for a larger skill, this supplied chunk's behavior is materially different from the declared primary purpose and exposes no evidence of the claimed research features. Therefore this is a description-behavior mismatch for the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises a multi-source recent-research capability with analysis and citations. The supplied code chunk does not perform any of those functions; it only sets a version string in a library initializer. Based on this code alone, the actual behavior does not match the declared purpose. This is a clear mismatch because the code shown has a materially different primary purpose: package metadata rather than social/web research.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description promises broad multi-platform recent research across nine named sources and a finished ranked, clustered brief with citations. This code chunk only covers four retrieval sources: X/Twitter, YouTube, Tavily web/news search, and Polymarket. It contains no Reddit, TikTok, Instagram, Hacker News, or GitHub access in the supplied code. It also does not perform clustering, final brief generation, or citation assembly beyond returning normalized result items; those higher-level behaviors may exist elsewhere but are not implemented here. Additionally, the module exposes a generic chat completion helper, which is an undeclared capability relative to the stated description. Therefore the declared description overstates the implemented behavior and omits a present capability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This code chunk does not implement the declared research behavior. Instead, it is an internal utility for deduplicating text items using n-gram and token Jaccard similarity. While deduplication could be a supporting component within a larger research pipeline, the task here is to compare the declared description to this specific supplied code chunk. The chunk neither queries recent data sources nor produces clustered ranked briefs with citations. Its primary purpose is materially different from the declared purpose, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This is a clear description-behavior mismatch. The declared purpose describes a comprehensive cross-platform recent-research skill over many social/web sources, whereas the actual code chunk is narrowly focused on GitHub. It calls GitHub search, repo, releases, README, and comments endpoints; supports issue/PR search plus person-mode and project-mode repo profiling; and enriches results with live star counts. Nothing in this chunk accesses Reddit, X, YouTube, TikTok, Instagram, Hacker News, Polymarket, or web search, nor does it generate clustered briefs with citations by itself. While GitHub is one of the declared sources, the declared description substantially overstates the implemented behavior of this code chunk, and the code also depends on GitHub auth/network access that is not reflected in the declared permissions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

There is a material description-to-behavior mismatch. The declared purpose describes a comprehensive multi-source research skill spanning numerous social platforms and producing synthesized ranked/clustered briefs. The actual code chunk is narrowly scoped to grounded web search through a single AISA/Tavily backend. No undeclared risky behavior is present, but the implemented behavior is substantially narrower than the declared functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description presents a broad last-30-days research skill spanning specific platforms (Reddit, X, YouTube, TikTok, Instagram, Hacker News, Polymarket, GitHub, and grounded web search). This code chunk instead is narrowly focused on Pinterest search using AISA/Tavily (site:pinterest.com {topic}), date filtering, and normalization of Pinterest pin-like results. Pinterest is an undeclared source, which is a direct description/behavior mismatch. Additionally, the code does not itself generate the declared final product of a ranked, clustered brief with citations; it only returns raw item lists. While this may be one component of a larger system, for the supplied chunk the implemented capability materially differs from the declared source coverage and purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The code substantially matches the declared primary purpose: it builds a recent multi-source research brief over approximately the last 30 days (configurable via lookback_days), using the listed major sources and producing ranked/clusted output with evidence items. That said, there are material undeclared capabilities beyond the description. The pipeline can also search Threads, Pinterest, and Xiaohongshu when available/requested, none of which are mentioned in the declared description. It also performs supplemental entity extraction from collected Reddit/X content to launch targeted X handle searches, and supports specialized GitHub person/project retrieval and post-rank star enrichment, which go beyond the plain description of general source research. Because the evaluation criteria say to flag undeclared capabilities when material, this should be marked as a mismatch, even though the main purpose is mostly aligned.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad recent-social/web research skill spanning many platforms and producing a clustered cited brief. The supplied code does something much narrower: it queries only Polymarket's public Gamma API, retrieves active prediction-market events, performs query expansion/domain expansion, filters noisy matches, computes relevance from title/outcomes plus liquidity/volume/movement signals, and returns normalized Polymarket items. This is not an unrelated malicious capability, but it is a materially narrower and different behavior than the declared end-to-end multi-source research capability. Therefore the description is not accurate for this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description is for an end-user research skill that gathers recent information from many platforms and produces a cited analytical brief. The supplied code chunk does something materially different: it defines reasoning provider interfaces, an AISA client wrapper, environment/model resolution logic, mock/local runtime selection, backend selection for X, and helpers for extracting JSON/text from model responses and streaming payloads. While such code could be a supporting subsystem within a larger research tool, this chunk itself does not access the listed platforms, run searches, aggregate evidence, cluster results, rank findings, or produce citations. Therefore, the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This code chunk’s primary purpose is materially different from the declared description. The description promises a full recent research capability across many platforms and grounded web search, but the actual code only evaluates source coverage/health for a prior research run and builds a quality-improvement message. It neither queries external platforms nor aggregates, ranks, clusters, or cites findings. While this could be a supporting utility within a larger research skill, the supplied chunk itself does not accurately represent the declared behavior, so this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description presents a full research skill that gathers recent evidence from many external sources and produces a ranked, clustered, cited brief. The actual code chunk does not implement any of those core behaviors. It only normalizes user queries by removing boilerplate words and identifying compound terms. While query preprocessing could be a supporting component of a larger research system, this chunk by itself materially differs from the declared primary purpose and lacks the advertised external access and analysis capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a broad cross-platform recent-research skill that surveys many social/web sources and returns a synthesized ranked, clustered brief with citations. The supplied code is narrowly scoped to Reddit. It contains Reddit query expansion, subreddit discovery heuristics, public Reddit search calls, and comment enrichment from Reddit JSON endpoints. The only external resources evidenced here are Reddit-related modules/endpoints. There is no code for X, YouTube, TikTok, Instagram, Hacker News, Polymarket, GitHub, grounded web search, clustering, ranking across sources, or final brief/citation synthesis. Therefore the description materially overstates and misrepresents this code chunk’s actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a comprehensive cross-platform research capability that searches many sources over the last 30 days and returns a ranked, clustered brief with citations. The provided code chunk does something much narrower: it enriches an already-known Reddit item by fetching Reddit thread data, extracting engagement metrics, top comments, dates, and heuristic comment insights. This is not merely an implementation detail of the declared behavior; it is a materially narrower and different function focused only on Reddit enrichment. There is no evidence here of cross-platform collection, web search, ranking/clustering of results, or citation-oriented brief generation. Therefore the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The code chunk is narrowly focused on Reddit public search behavior. It uses Reddit JSON endpoints, handles rate limits and network failures, parses posts, optionally enriches them with comments, and returns filtered/sorted Reddit items. The declared description presents a much broader, multi-platform research capability that synthesizes results into a ranked, clustered brief with citations. That broader behavior is not represented in this code chunk, so the description does not accurately match the supplied code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This code chunk is a narrow supporting library for relevance scoring, not an implementation of the declared end-user research skill. It does not access external platforms, perform recent-data collection, cluster findings, or generate cited briefs. While ranking is mentioned in the description, this file only provides one internal ranking component and lacks the core behaviors promised by the declared purpose. Therefore the description does not accurately represent what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description promises a multi-source recent-research capability producing a ranked, clustered brief with citations. The supplied code only covers a reranking module: it takes candidate results, asks an LLM to judge relevance, applies fallback scoring, and sorts results. That reranking function is plausibly a supporting implementation detail for the declared research pipeline, so by itself it would not necessarily be a mismatch. However, the same file also contains a distinct score_fun capability that judges items for humor, cleverness, wit, and shareability/virality, with dedicated prompts and heuristics. That is a materially different, undeclared capability not implied by the research brief description. Therefore this chunk does not accurately match the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description promises a comprehensive 30-day cross-platform social research capability with synthesized output. The supplied code chunk instead implements a narrow helper that runs a few web searches and extracts likely subreddit names, an X handle, GitHub identifiers, and a short current-events summary. While the 30-day date range and some platforms (Reddit, X, GitHub, news web search) partially align, the actual behavior is materially narrower and lacks the core advertised deliverable of a ranked, clustered brief with citations. This is a meaningful description/behavior mismatch rather than a mere implementation detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a comprehensive cross-platform recent-research skill covering several named platforms plus grounded web search, with output as a ranked, clustered brief with citations. The supplied code chunk is specifically a Threads module: it searches threads.net through AISA/Tavily, filters by date, computes simple relevance, and returns normalized item records. That is materially narrower than the declared purpose and also accesses a source not listed in the description (Threads). While this may be one subcomponent of a larger system, evaluating this chunk alone shows behavior not accurately represented by the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This code chunk’s primary behavior is a platform-specific Xiaohongshu HTTP search adapter, not a full cross-platform last-30-days research skill. The discrepancy is material because the declared description emphasizes broad aggregation across named sources and production of a clustered brief, while the code only queries Xiaohongshu and returns raw/normalized feed items with heuristic relevance. Xiaohongshu access is also an undeclared resource compared with the listed sources. The date filtering behavior further differs from the declared 'last 30 days' scope, using coarse presets such as one day, one week, or half year.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description presents a broad cross-platform 'last 30 days' research skill that aggregates many sources and produces a clustered cited brief. The supplied code chunk is much narrower: it is a YouTube module only. It searches YouTube through AISA, expands YouTube queries, optionally fetches transcripts by scraping YouTube watch pages and caption track URLs, cleans transcripts, and extracts highlight snippets. There is no implementation here for Reddit, X, TikTok, Instagram, Hacker News, Polymarket, GitHub, or grounded web search, nor for clustering or generating a final cited brief. Additionally, the direct transcript retrieval behavior is a notable capability not reflected in the declared description. While this may be a supporting enrichment feature, the main mismatch is that the actual code is only a YouTube subcomponent rather than the broadly described multi-source research skill.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/lib/env.py (reported line 20)May include surrounding context.

python
CONFIG_FILE = None
elif _config_override:
    CONFIG_DIR = Path(_config_override)
    CONFIG_FILE = CONFIG_DIR / ".env"
else:
    CONFIG_DIR = Path.cwd() / ".claude-skill-data" / "last30days"
    CONFIG_FILE = CONFIG_DIR / ".env"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/lib/env.py (reported line 23)May include surrounding context.

python
CONFIG_FILE = None
elif _config_override:
    CONFIG_DIR = Path(_config_override)
    CONFIG_FILE = CONFIG_DIR / ".env"
else:
    CONFIG_DIR = Path.cwd() / ".claude-skill-data" / "last30days"
    CONFIG_FILE = CONFIG_DIR / ".env"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/lib/env.py (reported line 65)May include surrounding context.

python
return env

def _find_project_env() -> Path | None:
    """Find per-project .env by walking up from cwd.

    Searches for .claude/last30days.env in each parent directory,
    stopping at the user's home directory or filesystem root.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/lib/env.py (reported line 87)May include surrounding context.

python
return env

def _find_project_env() -> Path | None:
    """Find per-project .env by walking up from cwd.

    Searches for .claude/last30days.env in each parent directory,
    stopping at the user's home directory or filesystem root.

Static analysis

No suspicious patterns detected.