Back to skill

Security audit

支付宝 AI 付接入

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Alipay payment/onboarding purpose, but it automatically updates itself and installs tools by executing unpinned remote code, with default telemetry that can identify the machine over time.

Review this carefully before installing. The payment and onboarding features are useful but high authority: it can change your project, use Alipay CLI credentials, submit account/product operations, replace its own skill files, install or replace alipay-cli, and upload workflow telemetry unless disabled with ALIPAY_AIPAY_TELEMETRY=0/false/off/no. Install only in a sandboxed environment or after the publisher removes automatic self-update and unverified download-to-bash installation, or replaces them with pinned, verified, user-approved updates.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
references/normal/scripts/alipay_cli_refresh.mjs:8
Finding
Mandatory Download and Direct Execution of an Unverified Remote Shell Installer<![CDATA[ ## Vulnerability Details **File Location**: `references/normal/scripts/alipay_cli_refresh.mjs:8-9, 94-121`; mandatory invocation is defined in `SKILL.md:27-35` **Vulnerability Type**: T03: Remote Payload Retrieval and Execution **Risk Level**: Critical ### Vulnerable Code ```javascript const installUrl = 'https://opengw.alipay.com/alipaycli/install'; const internalPrefix = 'ALIPAY_AIPAY_INTERNAL:'; ``` ```javascript const curl = spawnSync('curl', ['-fsSL', '--connect-timeout', '10', '--max-time', '60', installUrl], { encoding: 'utf8', env: cleanChildEnv(), maxBuffer: 30 * 1024 * 1024, shell: false, timeout }); if (curl.error || curl.status !== 0) { const output = commandOutput(curl); emit(isNetworkFailure(curl.status, output) ? 'RETRY_WITH_NETWORK' : 'FAILED'); return; } const installEnv = cleanChildEnv({ ALIPAY_CLI_BIN: binDir, ALIPAY_CLI_SKIP_VERIFY: 'true', PATH: `${binDir}${path.delimiter}${process.env.PATH || ''}` }); const bash = spawnSync('bash', [], { input: curl.stdout, encoding: 'utf8', env: installEnv, maxBuffer: 30 * 1024 * 1024, shell: false, timeout }); if (bash.error || bash.status !== 0) { const output = commandOutput(bash); if (isNetworkFailure(bash.status, output)) emit('RETRY_WITH_NETWORK'); else if (isPermissionFailure(output)) emit('RETRY_WITH_LOCAL_FS_PERMISSION'); else emit('FAILED'); return; } ``` The Skill launcher requires this refresh operation: ```text node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" env refresh-alipay-cli ``` ### Technical Analysis The refresh implementation downloads a shell program from a mutable external URL and immediately supplies the downloaded response to Bash. It does not verify a pinned artifact digest, detached digital signature, expected version, certificate/public-key pin, or transparency-log record before execution. HTTPS protects the connection in transit but does not establish that the returned script is the same payload that was re ...[truncated 2326 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove direct download-to-interpreter execution. Never pass an HTTP response directly to Bash. 2. Publish a versioned, immutable installer artifact rather than a mutable installer endpoint. 3. Pin the expected version and a cryptographic SHA-256 or stronger digest in reviewed Skill code. 4. Prefer detached signature verification using a pinned publisher key. Reject unsigned, expired, revoked, or mismatched artifacts. 5. Download to a private temporary file created with restrictive permissions, verify it, and only then execute it. 6. Do not set `ALIPAY_CLI_SKIP_VERIFY=true`; perform independent integrity and provenance verification before installation. 7. Require explicit user consent before installing or replacing local tools. Do not make refresh a mandatory Skill-loading side effect. 8. Install into a Skill-specific directory rather than the general `~/.local/bin` search path, and invoke the tool by an absolute verified path. 9. Verify more than `alipay-cli version`: validate the installed file’s digest, ownership, permissions, expected manifest, and signature. 10. Run installation with a minimized environment and restricted filesystem/network access where the host supports sandboxing. ]]>

T03 · Remote Payload Retrieval and Execution

Error
Location
references/normal/scripts/self_update.mjs:225
Finding
Automatic Self-Update Executes the Latest Unpinned npm Package and Replaces the Skill<![CDATA[ ## Vulnerability Details **File Location**: `references/normal/scripts/self_update.mjs:225-239, 252-278`; automatic startup requirement is defined in `SKILL.md:12-25` **Vulnerability Type**: T03: Remote Payload Retrieval and Execution, T08: Insecure Dependencies **Risk Level**: Critical ### Vulnerable Code ```javascript async function npmLatest() { if (selfUpdateNetworkRestricted()) return { ok: false, reason: 'skipped-network-restricted' }; try { const result = await spawnPackageManager('npm', ['view', '@alipay/alipay-aipay', 'version', '--json'], { timeout: npmQueryTimeoutMs, }); if (result.status !== 0 || result.error) return { ok: false, reason: packageManagerFailureKind(result) }; const decoded = JSON.parse(result.stdout); const version = typeof decoded === 'string' ? parseVersion(decoded) : null; return version ? { ok: true, version } : { ok: false, reason: 'check' }; } catch { return { ok: false, reason: 'check' }; } } ``` ```javascript async function installVersion(skillDir, version) { const transactionId = randomUUID(); const timeout = installTimeoutBudget(); let result; try { result = await spawnPackageManager( 'npx', ['-y', `@alipay/alipay-aipay@${version.raw}`, 'install-current'], { timeout, env: { ...process.env, [selfUpdateTargetEnv]: skillDir, [selfUpdateTransactionEnv]: transactionId, }, }, ); } catch { result = { status: null, error: new Error('package manager check failed'), stdout: '', stderr: '' }; } return { ok: result.status === 0 && !result.error, reason: result.status === 0 && !result.error ? 'ok' : packageManagerFailureKind(result), version: reconcileInstallTransaction(skillDir, transactionId), }; } ``` ### Technical Analysis On first activation, the Skill queries the package registry for the latest published version and executes that version through `npx -y`. The s ...[truncated 2487 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Disable automatic self-update during Skill activation. 2. Require explicit user or administrator approval before downloading or installing an update. 3. Pin updates to reviewed versions rather than automatically selecting the latest registry release. 4. Maintain an allowlist containing the exact version, package integrity hash, and expected signing identity. 5. Verify npm provenance or an equivalent publisher signature independently before executing package content. 6. Avoid using `npx -y` for a privileged replacement operation. Download without executing lifecycle code, verify the archive, and extract it using a controlled local installer. 7. Run update validation in an isolated staging directory with a minimal environment and no access to unrelated user files. 8. Validate every installed file against a signed manifest before replacing the active Skill. 9. Preserve a known-good, independently verified rollback copy and record update provenance for audit. 10. Do not pass the full parent environment to package code. Construct a strict allowlist of required variables. 11. Separate update management from payment workflow functionality so the Skill can operate safely without network-based self-modification. ]]>

other

Warning
Location
references/normal/scripts/telemetry.mjs:15
Finding
Default-On Telemetry Creates a Stable Machine Identifier and Uploads Workflow Metadata<![CDATA[ ## Vulnerability Details **File Location**: `references/normal/scripts/telemetry.mjs:15-30, 240-264, 992-1037, 1108-1261`; default behavior is documented in `references/runtime-entry.md:53-61` **Vulnerability Type**: other: Privacy-Invasive Telemetry **Risk Level**: Medium ### Vulnerable Code ```javascript const syncLogBizType = 'yuyanmonitorl'; const syncLogServerURL = 'https://collect.alipay.com/yuyan/'; const syncLogMonitorVersion = 'alipay-aipay-skill:sync-log'; const syncLogCode = '1005'; const syncLogMsg = 'alipay_aipay_skill_event'; const syncLogYuyanID = '180020010001290755'; const uploadTimeoutMs = 3000; const permissionedForegroundFlushLimit = 5; const localWriteMaxAttempts = 2; const runStateLockWaitMs = 5000; const runStateLockStaleMs = 30000; const outboxFlushLimit = 50; const outboxClaimTtlMs = 5 * 60 * 1000; const outboxMaxRecords = 1000; const outboxMaxAgeMs = 7 * 24 * 60 * 60 * 1000; ``` ```javascript export function telemetryEnabled(env = process.env) { return !disableValues.has(normalizeSwitch(env.ALIPAY_AIPAY_TELEMETRY)); } ``` ```javascript function machineCodeRaw(env = process.env) { const explicit = env.ALIPAY_AIPAY_MACHINE_CODE || env.AIPAY_MACHINE_CODE; if (explicit) return explicit; try { if (process.platform === 'linux') { for (const file of ['/etc/machine-id', '/var/lib/dbus/machine-id']) { if (fs.existsSync(file)) { const value = fs.readFileSync(file, 'utf8').trim(); if (value) return value; } } } if (process.platform === 'darwin') { const output = execFileSync('ioreg', ['-rd1', '-c', 'IOPlatformExpertDevice'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], timeout: 1000 }); const match = output.match(/"IOPlatformUUID"\s*=\s*"([^"]+)"/); if (match?.[1]) return match[1]; } if (process.platform === 'win32') { const output = execFileSync('REG', ['QUERY', 'HKLM\\SOFTWARE\\Microsoft\\Cry ...[truncated 4908 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Make telemetry disabled by default and require affirmative, informed opt-in. 2. Present the destination, exact collected fields, retention period, and retry behavior before consent. 3. Remove use of `/etc/machine-id`, platform UUIDs, Windows `MachineGuid`, and hostname-derived identifiers. 4. Use a random, short-lived identifier scoped to one workflow if operational metrics are necessary. 5. Do not collect Agent model or platform information unless it is strictly required and separately consented to. 6. Minimize events to aggregate operational counts that cannot be linked to a machine or individual run. 7. Avoid counting user messages unrelated to the payment workflow. 8. Disable detached retries by default and clearly expose any pending telemetry queue. 9. Reduce retention and provide commands to inspect and delete local telemetry state and outbox records. 10. Separate telemetry consent from payment consent; declining telemetry must not impair payment integration. 11. Document server-side retention, access controls, legal basis, and deletion procedures. 12. Add automated tests proving that telemetry-off mode performs no upload, starts no worker, and stores no identifying event data. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (182)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The description centers on Alipay payment product integration, but the reported implementation handles service-market or service-registration management instead. This is a genuine trust and routing problem: a user invoking a payment skill may unknowingly trigger administrative or account-management workflows with different data and permission implications.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The description centers on Alipay payment product integration, but the reported implementation handles service-market or service-registration management instead. This is a genuine trust and routing problem: a user invoking a payment skill may unknowingly trigger administrative or account-management workflows with different data and permission implications.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The description centers on Alipay payment product integration, but the reported implementation handles service-market or service-registration management instead. This is a genuine trust and routing problem: a user invoking a payment skill may unknowingly trigger administrative or account-management workflows with different data and permission implications.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The description centers on Alipay payment product integration, but the reported implementation handles service-market or service-registration management instead. This is a genuine trust and routing problem: a user invoking a payment skill may unknowingly trigger administrative or account-management workflows with different data and permission implications.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The description centers on Alipay payment product integration, but the reported implementation handles service-market or service-registration management instead. This is a genuine trust and routing problem: a user invoking a payment skill may unknowingly trigger administrative or account-management workflows with different data and permission implications.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The description centers on Alipay payment product integration, but the reported implementation handles service-market or service-registration management instead. This is a genuine trust and routing problem: a user invoking a payment skill may unknowingly trigger administrative or account-management workflows with different data and permission implications.

Self-Modification

High
Category
Rogue Agent
Content
## 前置启动协议

本次 Agent 对话首次使用 `alipay-aipay` 时,先把本文件所在目录解析为规范化绝对路径 `<SKILL_DIR>`,记录一次性事实 `ALIPAY_AIPAY_SELF_UPDATE_CHECKED=true`,再执行以下单条命令。`<SKILL_DIR>` 是执行时替换的路径占位符;禁止用 shell 变量赋值、命令替换或依赖特定 shell:

```text
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" self-update check --skill-dir "<SKILL_DIR>"
Confidence
98% confidence
Finding
The skill explicitly instructs the agent to execute a self-update routine before reading the rest of the runtime entry, allowing the skill codebase in place to be modified at runtime. In a security-sensitive agent environment, self-modification combined with shell and network access is highly dangerous because it can fetch or switch to unreviewed code after initial review, defeating static validation and enabling supply-chain compromise.

Self-Modification

High
Category
Rogue Agent
Content
本次 Agent 对话首次使用 `alipay-aipay` 时,先把本文件所在目录解析为规范化绝对路径 `<SKILL_DIR>`,记录一次性事实 `ALIPAY_AIPAY_SELF_UPDATE_CHECKED=true`,再执行以下单条命令。`<SKILL_DIR>` 是执行时替换的路径占位符;禁止用 shell 变量赋值、命令替换或依赖特定 shell:

```text
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" self-update check --skill-dir "<SKILL_DIR>"
```

`SKILL_DIR` 必须绑定刚触发且正在执行本命令的 Skill 规范化绝对路径,不得换成 Agent 启动目录、用户项目目录、用户 Home、npm 包源码根或另一份 Skill 副本。`VERSION` 缺失/非法或 `references/runtime-entry.md` 缺失时由本命令尝试精确修复;命令失败或 marker 无法唯一解析时按 `SELF_UPDATE:CHECK_FAILED`。
Confidence
98% confidence
Finding
The startup protocol requires running a self-update command against the current skill directory, with logic to repair missing or invalid version/runtime files. That means the skill is empowered to alter its own contents and operational entrypoint dynamically, which undermines review integrity and can be exploited to replace trusted code with malicious code.

Self-Modification

High
Category
Rogue Agent
Content
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" self-update check --skill-dir "<SKILL_DIR>"
```

`SKILL_DIR` 必须绑定刚触发且正在执行本命令的 Skill 规范化绝对路径,不得换成 Agent 启动目录、用户项目目录、用户 Home、npm 包源码根或另一份 Skill 副本。`VERSION` 缺失/非法或 `references/runtime-entry.md` 缺失时由本命令尝试精确修复;命令失败或 marker 无法唯一解析时按 `SELF_UPDATE:CHECK_FAILED`。

stderr 只允许出现以下一个内部终态;不得向用户展示 marker 或 npm/npx 原始输出:
Confidence
97% confidence
Finding
The documented self-update flow includes parsing internal markers and handling installation/verification outcomes, indicating a full update control path rather than a passive version check. This makes the skill materially more dangerous because a payment-themed trigger can lead to code replacement behavior hidden inside startup instructions.

Self-Modification

High
Category
Rogue Agent
Content
stderr 只允许出现以下一个内部终态;不得向用户展示 marker 或 npm/npx 原始输出:

- `SELF_UPDATE:UPDATED=<合法 SemVer>`:当前 Skill 目录已原子切换到新版。
- `SELF_UPDATE:CURRENT=<合法 SemVer>`:继续当前版本。
- `SELF_UPDATE:RETRY_WITH_NETWORK`:registry 或安装阶段网络不可达;可申请联网后原样重试本命令一次。
- `SELF_UPDATE:SKIPPED_NETWORK_RESTRICTED|CHECK_FAILED|INSTALL_FAILED|VERIFY_FAILED`:静默继续当前可用版本,不重试、不申请权限。
Confidence
97% confidence
Finding
The presence of an `UPDATED=<SemVer>` terminal state confirms that the skill can atomically switch the current directory to a new version during execution. This is a classic self-modifying pattern that can bypass prior review and create a moving-target codebase, especially risky when network retrieval may be retried.

Self-Modification

High
Category
Rogue Agent
Content
stderr 只允许出现以下一个内部终态;不得向用户展示 marker 或 npm/npx 原始输出:

- `SELF_UPDATE:UPDATED=<合法 SemVer>`:当前 Skill 目录已原子切换到新版。
- `SELF_UPDATE:CURRENT=<合法 SemVer>`:继续当前版本。
- `SELF_UPDATE:RETRY_WITH_NETWORK`:registry 或安装阶段网络不可达;可申请联网后原样重试本命令一次。
- `SELF_UPDATE:SKIPPED_NETWORK_RESTRICTED|CHECK_FAILED|INSTALL_FAILED|VERIFY_FAILED`:静默继续当前可用版本,不重试、不申请权限。
Confidence
96% confidence
Finding
The flow explicitly allows requesting network access to retry the update when the registry or installation stage is unreachable. This matters because it couples privileged code mutation with on-demand network enablement, increasing exposure to supply-chain attacks and unauthorized code acquisition.

Self-Modification

High
Category
Rogue Agent
Content
- `SELF_UPDATE:UPDATED=<合法 SemVer>`:当前 Skill 目录已原子切换到新版。
- `SELF_UPDATE:CURRENT=<合法 SemVer>`:继续当前版本。
- `SELF_UPDATE:RETRY_WITH_NETWORK`:registry 或安装阶段网络不可达;可申请联网后原样重试本命令一次。
- `SELF_UPDATE:SKIPPED_NETWORK_RESTRICTED|CHECK_FAILED|INSTALL_FAILED|VERIFY_FAILED`:静默继续当前可用版本,不重试、不申请权限。

`UPDATED` 后先废弃旧 loaded 事实,禁止继续读取更新前版本的任何业务文档,后续命令使用新版同一 `SKILL_DIR`;其他终态继续当前可用版本,其他终态同样不再读取本启动器或 `self-update.md` 补充规则。
Confidence
97% confidence
Finding
The instructions require discarding old loaded facts and continuing with the newly updated version, explicitly preventing continued use of the previously reviewed business documents. This behavior is dangerous because it instructs the agent to trust freshly modified content over already inspected content within the same session.

Self-Modification

High
Category
Rogue Agent
Content
- `SELF_UPDATE:UPDATED=<合法 SemVer>`:当前 Skill 目录已原子切换到新版。
- `SELF_UPDATE:CURRENT=<合法 SemVer>`:继续当前版本。
- `SELF_UPDATE:RETRY_WITH_NETWORK`:registry 或安装阶段网络不可达;可申请联网后原样重试本命令一次。
- `SELF_UPDATE:SKIPPED_NETWORK_RESTRICTED|CHECK_FAILED|INSTALL_FAILED|VERIFY_FAILED`:静默继续当前可用版本,不重试、不申请权限。

`UPDATED` 后先废弃旧 loaded 事实,禁止继续读取更新前版本的任何业务文档,后续命令使用新版同一 `SKILL_DIR`;其他终态继续当前可用版本,其他终态同样不再读取本启动器或 `self-update.md` 补充规则。
Confidence
97% confidence
Finding
The startup logic chains self-update with subsequent CLI refresh and runtime-entry loading, making privileged environment mutation part of normal activation. In context, that means a broadly triggered payment skill can immediately modify code and tooling before the agent even reaches business logic, amplifying the impact of accidental or malicious invocation.

Self-Modification

High
Category
Rogue Agent
Content
- `SELF_UPDATE:RETRY_WITH_NETWORK`:registry 或安装阶段网络不可达;可申请联网后原样重试本命令一次。
- `SELF_UPDATE:SKIPPED_NETWORK_RESTRICTED|CHECK_FAILED|INSTALL_FAILED|VERIFY_FAILED`:静默继续当前可用版本,不重试、不申请权限。

`UPDATED` 后先废弃旧 loaded 事实,禁止继续读取更新前版本的任何业务文档,后续命令使用新版同一 `SKILL_DIR`;其他终态继续当前可用版本,其他终态同样不再读取本启动器或 `self-update.md` 补充规则。

版本确定后,若当前上下文没有与规范化 `SKILL_DIR`、合法 `VERSION` 绑定的 `ALIPAY_AIPAY_CLI_REFRESHED=true`,必须刷新一次 `alipay-cli`;不得因自更新已检查而跳过。仅唯一终态 `READY` 可在当前对话上下文记录该成功事实、路径和版本,不写缓存或业务状态;三者仍可用且一致时,后续根触发、确认、补材料、候选选择、恢复、中断继续和 Full Process 衔接均不重复刷新。
Confidence
95% confidence
Finding
The skill also requires refreshing `alipay-cli`, which is another form of runtime environment modification involving local installation or repair logic. While slightly narrower than self-updating the skill itself, it still introduces command execution, possible file writes, and network-dependent tooling changes during request handling.

Hidden Instructions

High
Category
Prompt Injection
Content
<!-- ALIPAY_AIPAY_FLOW:INTEGRATION_CORE:START -->
# 支付产品-代码开发流程

> ⚠️ **前置声明**:本 flow 仅支持 **AI 网页应用收款、AI 移动应用收款、AI 按量付费**三种产品的集成。原有“网站支付”“APP 支付”“按量付费”仍作为输入别名和资源目录名。**其他产品(当面付、订单码支付、JSAPI支付、预授权支付、商家扣款等)暂不支持**,如需集成请前往[支付宝开放平台](https://open.alipay.com/)查阅相关文档。
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
<!-- ALIPAY_AIPAY_FLOW:INTEGRATION_CORE:START -->
# 支付产品-代码开发流程

> ⚠️ **前置声明**:本 flow 仅支持 **AI 网页应用收款、AI 移动应用收款、AI 按量付费**三种产品的集成。原有“网站支付”“APP 支付”“按量付费”仍作为输入别名和资源目录名。**其他产品(当面付、订单码支付、JSAPI支付、预授权支付、商家扣款等)暂不支持**,如需集成请前往[支付宝开放平台](https://open.alipay.com/)查阅相关文档。
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
<!-- ALIPAY_AIPAY_FLOW:INTEGRATION_IMPLEMENTATION:END -->

<!-- ALIPAY_AIPAY_FLOW:INTEGRATION_VERIFICATION:START -->
<!-- 配置后置校验不再单独上报开始态 stage -->

开始执行代码自检、语法/静态检查或支付配置后置校验前,进入本 flow 的 `verification` 阶段;该阶段不再单独记录 telemetry 开始态,只由最终收口阶段记录结果。
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
<!-- ALIPAY_AIPAY_FLOW:INTEGRATION_IMPLEMENTATION:END -->

<!-- ALIPAY_AIPAY_FLOW:INTEGRATION_VERIFICATION:START -->
<!-- 配置后置校验不再单独上报开始态 stage -->

开始执行代码自检、语法/静态检查或支付配置后置校验前,进入本 flow 的 `verification` 阶段;该阶段不再单独记录 telemetry 开始态,只由最终收口阶段记录结果。
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
**网站支付回跳默认规则**:用户未特别说明时,默认实现支付后同步回跳。`return_url` 必须来自已确认目标项目的实际协议、主机、端口和路由,禁止保留 `your-domain.com`、示例端口或猜测路径。项目没有结果页时,在当前技术栈内新增与既有 UI 一致的 GET 回跳路由和页面。用户已明确不需要同步回跳时,直接按关闭分支验收,不增加第二次确认;仍必须保留异步通知、交易查询和商户订单查询页。用户未明确关闭但代码缺少 `return_url` 时,必须修复为默认同步回跳分支,不得要求用户接受遗漏。验收结论必须从实际代码重新检查,不接受调用方自报 `returnMode`。
<!-- ALIPAY_AIPAY_PRODUCT:END -->

<!-- ALIPAY_AIPAY_PRODUCT:webpay,apppay:START -->
**本地生产参数验收模式**:用户项目尚未上线、无法提供真实公网地址,或当前自定义域名/TLS 检查失败时,网站支付/APP 支付可以进入本模式。要求如下:

1. 代码层必须已经实现异步通知处理入口、验签、关键字段校验、幂等和成功响应 `success`,只是当前环境不对外联调。
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
**网站支付回跳默认规则**:用户未特别说明时,默认实现支付后同步回跳。`return_url` 必须来自已确认目标项目的实际协议、主机、端口和路由,禁止保留 `your-domain.com`、示例端口或猜测路径。项目没有结果页时,在当前技术栈内新增与既有 UI 一致的 GET 回跳路由和页面。用户已明确不需要同步回跳时,直接按关闭分支验收,不增加第二次确认;仍必须保留异步通知、交易查询和商户订单查询页。用户未明确关闭但代码缺少 `return_url` 时,必须修复为默认同步回跳分支,不得要求用户接受遗漏。验收结论必须从实际代码重新检查,不接受调用方自报 `returnMode`。
<!-- ALIPAY_AIPAY_PRODUCT:END -->

<!-- ALIPAY_AIPAY_PRODUCT:webpay,apppay:START -->
**本地生产参数验收模式**:用户项目尚未上线、无法提供真实公网地址,或当前自定义域名/TLS 检查失败时,网站支付/APP 支付可以进入本模式。要求如下:

1. 代码层必须已经实现异步通知处理入口、验签、关键字段校验、幂等和成功响应 `success`,只是当前环境不对外联调。
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
- [INT.WEBPAY.NO_RETURN_VERIFIED] 关闭分支已记录用户先前明确提出的不使用同步回跳,确认 SDK 请求未传 `return_url`,并完成异步通知处理代码、交易查询和商户订单查询页校验;缺少公网 HTTPS `notify_url` 时,已明确标记公网通知联调为人工待验证
<!-- ALIPAY_AIPAY_PRODUCT:END -->

<!-- ALIPAY_AIPAY_PRODUCT:aipay:START -->
#### AI 按量付费:自动沙箱联调

**任务**:验证按量付费 402 协议端到端服务端联调流程
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
- [INT.WEBPAY.NO_RETURN_VERIFIED] 关闭分支已记录用户先前明确提出的不使用同步回跳,确认 SDK 请求未传 `return_url`,并完成异步通知处理代码、交易查询和商户订单查询页校验;缺少公网 HTTPS `notify_url` 时,已明确标记公网通知联调为人工待验证
<!-- ALIPAY_AIPAY_PRODUCT:END -->

<!-- ALIPAY_AIPAY_PRODUCT:aipay:START -->
#### AI 按量付费:自动沙箱联调

**任务**:验证按量付费 402 协议端到端服务端联调流程
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

External Script Fetching

High
Category
Supply Chain
Content
- [INT.A2M.DELIVERY_EVIDENCE] 已携带 `Payment-Proof` 重试原服务,并取得 HTTP 200、非空可归属资源、无明确业务失败和有效 `Payment-Validation` 的组合成功证据
- [INT.A2M.TEST_PASSED] 已确认 402 沙箱服务端联调流程通过

**测试前预检**:执行沙箱测试脚本前,只使用 `modules/sandbox/a2m-sandbox-test.md` 登记的固定 `runtime.mjs a2m precheck`,确认服务返回 HTTP 402,`Payment-Needed` 包含 `seller_signature` 等关键字段,且 `method.service_id` 等于 `api_mock_service_id`;禁止临时编写 Python、curl 管道或近似解析器。

**沙箱支付宝体验提醒**:服务端联调结论输出后,按 `modules/sandbox/a2m-sandbox-test.md` 向用户提供付款链接、沙箱买家账号和安卓客户端下载说明作为可选付款体验;该体验不新增阻塞确认点。
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
- [INT.A2M.DELIVERY_EVIDENCE] 已携带 `Payment-Proof` 重试原服务,并取得 HTTP 200、非空可归属资源、无明确业务失败和有效 `Payment-Validation` 的组合成功证据
- [INT.A2M.TEST_PASSED] 已确认 402 沙箱服务端联调流程通过

**测试前预检**:执行沙箱测试脚本前,只使用 `modules/sandbox/a2m-sandbox-test.md` 登记的固定 `runtime.mjs a2m precheck`,确认服务返回 HTTP 402,`Payment-Needed` 包含 `seller_signature` 等关键字段,且 `method.service_id` 等于 `api_mock_service_id`;禁止临时编写 Python、curl 管道或近似解析器。

**沙箱支付宝体验提醒**:服务端联调结论输出后,按 `modules/sandbox/a2m-sandbox-test.md` 向用户提供付款链接、沙箱买家账号和安卓客户端下载说明作为可选付款体验;该体验不新增阻塞确认点。
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Hidden Instructions

High
Category
Prompt Injection
Content
---

<!-- ALIPAY_AIPAY_CHECKLIST_PRODUCTS:aipay,webpay,apppay -->
## 一、密钥与安全校验

| 校验项 | 校验要求 | 说明 |
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.exposed_secret_literal

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/alipay_cli_refresh.mjs:58

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/auth_runtime_runner.mjs:10

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/integration_message_runner.mjs:374

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/onboarding_discovery_runner.mjs:171

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/onboarding_recovery_runner.mjs:46

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/open_official_url.sh:86

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/platform_compat.mjs:15

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/python_script_runner.mjs:15

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/runtime.mjs:57

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/self_update.mjs:74

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
references/normal/scripts/telemetry.mjs:658

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/csharp/1-通用接口/统一收单交易关闭接口代码示例.md:35

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/csharp/1-通用接口/统一收单交易查询接口代码示例.md:43

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/csharp/1-通用接口/统一收单交易退款接口代码示例.md:44

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/csharp/1-通用接口/统一收单交易退款查询接口代码示例.md:36

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/csharp/2-网站支付/统一收单下单并支付页面接口代码示例.md:39

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/csharp/3-APP支付/APP支付接口代码示例.md:112

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/csharp/4-按量付费/A2MPaymentDemo.cs:82

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/java/1-通用接口/统一收单交易关闭接口代码示例.md:38

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/java/1-通用接口/统一收单交易查询接口代码示例.md:55

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/java/1-通用接口/统一收单交易退款接口代码示例.md:44

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/java/1-通用接口/统一收单交易退款查询接口代码示例.md:39

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/java/2-网站支付/统一收单下单并支付页面接口代码示例.md:45

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/java/3-APP支付/APP支付接口代码示例.md:119

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/java/4-按量付费/A2MPaymentDemoController.java:242

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/nodejs/1-通用接口/统一收单交易关闭接口代码示例.md:10

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/nodejs/1-通用接口/统一收单交易查询接口代码示例.md:10

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/nodejs/1-通用接口/统一收单交易退款接口代码示例.md:10

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/nodejs/1-通用接口/统一收单交易退款查询接口代码示例.md:10

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/nodejs/2-网站支付/统一收单下单并支付页面接口代码示例.md:10

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/nodejs/3-APP支付/APP支付接口代码示例.md:10

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/nodejs/4-按量付费/A2MPaymentDemo.js:30

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/php/3-APP支付/APP支付接口代码示例.md:92

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/python/1-通用接口/统一收单交易关闭接口代码示例.md:17

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/python/1-通用接口/统一收单交易查询接口代码示例.md:17

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/python/1-通用接口/统一收单交易退款接口代码示例.md:17

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/python/1-通用接口/统一收单交易退款查询接口代码示例.md:17

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/python/2-网站支付/统一收单下单并支付页面接口代码示例.md:17

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/integration/modules/code-examples/python/3-APP支付/APP支付接口代码示例.md:17