T01 · Skill Instruction Hijacking
- Location
.codex/instructions.md:133- Finding
<![CDATA[Mandatory Third-Party Promotion Hijacks Agent Workflow and Withholds Requested Results]]>
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent research helper, but it needs review because optional API credentials can be sent to unvalidated environment-controlled endpoints and its agent instructions can block normal results to push API setup.
Review this skill before installing if you plan to use API keys. Do not set TAVILY_API_URL, BAIDU_API_ENDPOINT, or TENCENTCLOUD_WSA_ENDPOINT unless you fully trust the destination, use --no-cache for sensitive searches, and treat the Tavily/Tencent setup prompts as optional rather than required. Avoid fetching untrusted WeChat article URLs until redirect validation is tightened.
.codex/instructions.md:133<![CDATA[Mandatory Third-Party Promotion Hijacks Agent Workflow and Withholds Requested Results]]>
scripts/tavily_adapter.py:14<![CDATA[Environment-Controlled API Endpoints Can Receive Search Queries and Authentication Credentials]]>
scripts/wechat_fetch/wx-article-fetch.js:47<![CDATA[WeChat Fetcher Follows Redirects to Unrestricted Hosts, Enabling SSRF]]>
scripts/cache.py:16<![CDATA[Plaintext HTTP Cache Persists Sensitive Search Queries and Response Content]]>
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
try:
req = _build_request(payload, api_key)
with urllib.request.urlopen(req, timeout=timeout) as resp:
data = json.loads(resp.read().decode("utf-8", errors="ignore"))
except urllib.error.HTTPError as e:
body = e.read() if hasattr(e, "read") else b""
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
try:
req = _build_request(payload, secret_id, secret_key)
with urllib.request.urlopen(req, timeout=timeout) as resp:
data = json.loads(resp.read().decode("utf-8", errors="ignore"))
except urllib.error.HTTPError as e:
body = e.read() if hasattr(e, "read") else b""
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.
- Flag contradictions, don't judge
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.
- Flag contradictions, don't judge
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
*.swo
# Local secrets and environment
.env
.env.*
*.pem
*.key
The trigger keywords include very broad everyday phrases such as '搜一下', '查一下', and '搜索', which can cause the skill to activate for routine requests far beyond high-assurance research use cases. In a skill with network access, shell-capable tools, and default file output behavior, overbroad activation increases the chance of unexpected searches, unnecessary external data retrieval, and unintended side effects.
Referenced artifact was not completely inspected
| 1.5 | **强制**:调用 `scripts/search_engine.py` 前,先用 LLM 提取 2-5 个核心搜索概念,并通过 `--search-concepts` 传入 | 概念列表 |
Referenced artifact was not completely inspected
| 1.5 | **强制**:调用 `scripts/search_engine.py` 前,先用 LLM 提取 2-5 个核心搜索概念,并通过 `--search-concepts` 传入 | 概念列表 |
Referenced artifact was not completely inspected
| 1.5 | **强制**:调用 `scripts/search_engine.py` 前,先用 LLM 提取 2-5 个核心搜索概念,并通过 `--search-concepts` 传入 | 概念列表 |
Referenced artifact was not completely inspected
| 1.5 | **强制**:调用 `scripts/search_engine.py` 前,先用 LLM 提取 2-5 个核心搜索概念,并通过 `--search-concepts` 传入 | 概念列表 |
Referenced artifact was not completely inspected
| 1.5 | **强制**:调用 `scripts/search_engine.py` 前,先用 LLM 提取 2-5 个核心搜索概念,并通过 `--search-concepts` 传入 | 概念列表 |
Referenced artifact was not completely inspected
| 1.5 | **强制**:调用 `scripts/search_engine.py` 前,先用 LLM 提取 2-5 个核心搜索概念,并通过 `--search-concepts` 传入 | 概念列表 |
Referenced artifact was not completely inspected
| 1.5 | **强制**:调用 `scripts/search_engine.py` 前,先用 LLM 提取 2-5 个核心搜索概念,并通过 `--search-concepts` 传入 | 概念列表 |
The main factual claim cites supporting evidence that the same file's perspective map says must not be used as fact and is for background or hypothesis only. This is a direct trust-boundary violation: downstream consumers may rely on labels like supporting_evidence and trusted_candidate rather than the more restrictive annotations, leading to misinformation laundering.
The file marks a trusted conclusion as usable for candidate conclusions while its cited support is restricted elsewhere to background, context-only, or historical use. That contradiction can cause downstream agents to elevate weak or non-factual material into factual output, producing integrity failures in research or decision-support workflows.
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.
- "Better less than fake": Mark insufficient info clearly
- "Never fill gaps with speculation"
- "Always cite sources"
- "Flag contradictions, don't judge"
- Keep context below the 256k red line; use lite / standard / deep budgets
- Prefer --budget auto unless the user explicitly asks for a larger or smaller pack
- Use --checkpoint auto by default; batch for clear direct research, interactive for high-risk or ambiguous work
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
def _apply_env_overrides(config: dict) -> dict:
"""从环境变量读取覆盖值。前缀 VSP_,用双下划线表示嵌套。"""
env_prefix = "VSP_"
for key, value in os.environ.items():
if not key.startswith(env_prefix):
continue
rest = key[len(env_prefix):].lower()
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
user = user_path or _user_config_path()
if os.path.exists(user):
sources.append(("user", user))
if apply_env and any(k.startswith("VSP_") for k in os.environ):
sources.append(("environment", "VSP_*"))
return sources
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
<html>
<head><title>OpenAI CEO 是谁 - 搜狗搜索</title></head>
<body>
<!-- 真实搜狗结果页裁剪样本(BUG-ENV-2 回归 fixture):
保留关键结构漂移点 ——
1) 经典结果块 <div class="vrwrap"> 内 <h3 class="vr-title"><a href="/link?url=..."> 加密相对链接
2) h3 与 a 之间的 HTML 注释(<!--awbg3-->)及 a 内 <!--red_beg--> 高亮注释
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
<html>
<head><title>OpenAI CEO 是谁 - 搜狗搜索</title></head>
<body>
<!-- 真实搜狗结果页裁剪样本(BUG-ENV-2 回归 fixture):
保留关键结构漂移点 ——
1) 经典结果块 <div class="vrwrap"> 内 <h3 class="vr-title"><a href="/link?url=..."> 加密相对链接
2) h3 与 a 之间的 HTML 注释(<!--awbg3-->)及 a 内 <!--red_beg--> 高亮注释
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
标题/链接均取自 2026-07 真实查询 "OpenAI CEO 是谁" 的结果页。 -->
<div class="card30010546__wrap_30e3 vrwrap card30010546__expStyle_30e3" data-reactroot=""><div class="card30010546__titleWrap_30e3 fontExp"><a target="_blank" id="sogou_vr_30010546_title_1" href="https://newsa.html5.qq.com/v1/share-video?vid=3822791983291374955" class="link__saLink_bda5" vrcid="Link."><div>Palantir CEO OpenAI 是小偷:拆解 Karp 的指控</div></a></div></div>
<div class="vrwrap middle-better-hintBox" id="sogou_vr_30010467_2"><div class="vrTitle"><span>大家还在搜</span></div><div class="hint-mid" data-hint="middle" data-rank="2"><span><a href="?user_ip=222&bh=1&query=%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD" id="sogou_vr_30010467_1_2">人工智能open ai官网</a></span></div></div>
<div class="vrwrap" id="sogou_vr_30000000_wrap_3"><h3 class="vr-title"><!--awbg3--><a name="dttl" target="_blank" href="/link?url=hedJjaC291NbWrwHYHKCyPvjU9Tbu8QRaJrgRIXUqR5_WF_WH2CNvjEmYzjwUqfhX4RmQ9MllJw." id="sogou_vr_30000000_3" cachestrategy="qcr:-1" bingpb=""><!--awbg3--><em>OpenAI CEO</em>奥特曼为Reddit第三大股东,他曾当过8天临时CEO|...</a></h3><div class="fz-mid space-txt base-ellipsis clamp2" id="cacheresult_summary_3"><em>OpenAI的首席执行官萨姆·奥特曼</em>(Sam Altman)是Reddit的主要股东之一,拥有公司8.7%的股份。</div> <a class="citeLinkClass" target="_blank" href="/link?url=hedJjaC291NbWrwHYHKCyPvjU9Tbu8QRaJrgRIXUqR5_WF_WH2CNvjEmYzjwUqfhX4RmQ9MllJw." id="cacheresult_cite_3"> <span>网易</span> <span>2024-02-23</span> </a></div>
<div class="vrwrap"> <style>.struct201102 .real-tag { color: #205aef; }</style> <div class="struct201102"> <h3 class="vr-title " vrcid="title.ba18e87"> <a class=" " target="_blank" href="/link?url=hedJjaC291NbWrwHYHKCyPvjU9Tbu8QRaJrgRIXUqR7_IrlLrbKhVr9OCf4mlvJn2eEqArQsEhY."><em><!--red_beg-->OpenAI CEO<!--red_end--></em>:当年马斯克骂我们都<em><!--red_beg-->是<!--red_end--></em>蠢货,然后就离开了|openai|<em><!--red_beg-->人工<!--red_end--></em>...</a> </h3> <div class="fz-mid space-txt base-ellipsis clamp2">OpenAI CEO 萨姆·奥特曼与埃隆·马斯克的恩怨始于 2015 年公司创立之初。</div> </div></div>
<div class="vrw
...[truncated 25 chars]
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
<div class="card30010546__wrap_30e3 vrwrap card30010546__expStyle_30e3" data-reactroot=""><div class="card30010546__titleWrap_30e3 fontExp"><a target="_blank" id="sogou_vr_30010546_title_1" href="https://newsa.html5.qq.com/v1/share-video?vid=3822791983291374955" class="link__saLink_bda5" vrcid="Link."><div>Palantir CEO OpenAI 是小偷:拆解 Karp 的指控</div></a></div></div>
<div class="vrwrap middle-better-hintBox" id="sogou_vr_30010467_2"><div class="vrTitle"><span>大家还在搜</span></div><div class="hint-mid" data-hint="middle" data-rank="2"><span><a href="?user_ip=222&bh=1&query=%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD" id="sogou_vr_30010467_1_2">人工智能open ai官网</a></span></div></div>
<div class="vrwrap" id="sogou_vr_30000000_wrap_3"><h3 class="vr-title"><!--awbg3--><a name="dttl" target="_blank" href="/link?url=hedJjaC291NbWrwHYHKCyPvjU9Tbu8QRaJrgRIXUqR5_WF_WH2CNvjEmYzjwUqfhX4RmQ9MllJw." id="sogou_vr_30000000_3" cachestrategy="qcr:-1" bingpb=""><!--awbg3--><em>OpenAI CEO</em>奥特曼为Reddit第三大股东,他曾当过8天临时CEO|...</a></h3><div class="fz-mid space-txt base-ellipsis clamp2" id="cacheresult_summary_3"><em>OpenAI的首席执行官萨姆·奥特曼</em>(Sam Altman)是Reddit的主要股东之一,拥有公司8.7%的股份。</div> <a class="citeLinkClass" target="_blank" href="/link?url=hedJjaC291NbWrwHYHKCyPvjU9Tbu8QRaJrgRIXUqR5_WF_WH2CNvjEmYzjwUqfhX4RmQ9MllJw." id="cacheresult_cite_3"> <span>网易</span> <span>2024-02-23</span> </a></div>
<div class="vrwrap"> <style>.struct201102 .real-tag { color: #205aef; }</style> <div class="struct201102"> <h3 class="vr-title " vrcid="title.ba18e87"> <a class=" " target="_blank" href="/link?url=hedJjaC291NbWrwHYHKCyPvjU9Tbu8QRaJrgRIXUqR7_IrlLrbKhVr9OCf4mlvJn2eEqArQsEhY."><em><!--red_beg-->OpenAI CEO<!--red_end--></em>:当年马斯克骂我们都<em><!--red_beg-->是<!--red_end--></em>蠢货,然后就离开了|openai|<em><!--red_beg-->人工<!--red_end--></em>...</a> </h3> <div class="fz-mid space-txt base-ellipsis clamp2">OpenAI CEO 萨姆·奥特曼与埃隆·马斯克的恩怨始于 2015 年公司创立之初。</div> </div></div>
<div class="vrwrap" id="sogou_vr_30000909_wrap_5"><div class="s
...[truncated 25 chars]
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
class SearchEngineCliTests(unittest.TestCase):
def test_tavily_missing_key_degrades_to_empty_json(self):
env = os.environ.copy()
env.pop("TAVILY_API_KEY", None)
result = subprocess.run(
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
class SearchEngineCliTests(unittest.TestCase):
def test_tavily_missing_key_degrades_to_empty_json(self):
env = os.environ.copy()
env.pop("TAVILY_API_KEY", None)
result = subprocess.run(
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
class SearchEngineCliTests(unittest.TestCase):
def test_tavily_missing_key_degrades_to_empty_json(self):
env = os.environ.copy()
env.pop("TAVILY_API_KEY", None)
result = subprocess.run(
Detected: suspicious.exposed_secret_literal