Back to skill

Security audit

钉钉通知 (DingTalk Notify)

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this skill suspicious because it reports a possible risk of exposing DingTalk credentials in error output, alongside broad environment access and external messaging; the review is incomplete because a referenced INSTALL.md file was missing.

Consider the possible credential exposure before installing, especially if logs or standard output are accessible to others. The scanner reports external DingTalk requests and a messaging command, and flags full environment copying for review. Its analysis is partial because the referenced INSTALL.md was missing, so installation-related evidence is incomplete.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (21)

Tainted flow: 'APP_KEY' from os.environ.get (line 77, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
94% confidence
Finding

Authenticating to DingTalk is legitimate, but this request places APP_SECRET in the URL query string. Requests exceptions can include that complete URL, and the surrounding handler converts exceptions to strings and writes them to stdout and the failure log, potentially exposing the application secret to readers of those outputs.

Content

Scanner excerpt · scripts/notify.py (reported line 114)May include surrounding context.

python
last_err = None
    for attempt in range(retries + 1):
        try:
            resp = requests.get(
                "https://oapi.dingtalk.com/gettoken",
                params={"appkey": APP_KEY, "appsecret": APP_SECRET},
                timeout=timeout,

Tainted flow: 'payload' from os.environ.get (line 160, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/notify.py (reported line 164)May include surrounding context.

python
url = f"https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2?access_token=%2A%2A%2A}"

    try:
        resp = requests.post(url, json=payload, timeout=DEFAULT_TIMEOUT).json()
    except requests.exceptions.RequestException as e:
        print(f"❌ 发送异常: {e}")
        log_failure(task, f"发送异常 -> {userid}: {e}")

Tainted flow: 'payload' from os.environ.get (line 220, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/notify.py (reported line 224)May include surrounding context.

python
"msg": {"msgtype": "file", "file": {"media_id": media_id}}}
    url = f"https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2?access_token=%2A%2A%2A}"
    try:
        resp = requests.post(url, json=payload, timeout=DEFAULT_TIMEOUT).json()
    except requests.exceptions.RequestException as e:
        print(f"❌ 文件发送异常: {e}")
        log_failure(task, f"文件发送异常 -> {userid}: {e}")

Tainted flow: 'APP_KEY' from os.environ.get (line 77, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/notify.py (reported line 250)May include surrounding context.

python
last_err = None
    for attempt in range(retries + 1):
        try:
            resp = requests.post(
                "https://api.dingtalk.com/v1.0/oauth2/accessToken",
                json={"appKey": APP_KEY, "appSecret": APP_SECRET},
                timeout=timeout,

Tainted flow: 'payload' from os.environ.get (line 282, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/notify.py (reported line 286)May include surrounding context.

python
"msgKey": msg_key, "msgParam": json.dumps(param, ensure_ascii=False)}
    url = "https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend"
    try:
        resp = requests.post(
            url,
            headers={"x-acs-dingtalk-access-token": token, "Content-Type": "application/json"},
            data=json.dumps(payload, ensure_ascii=False).encode(),

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/notify.py (reported line 318)May include surrounding context.

python
print("❌ 未配置 DINGTALK_MY_NAME(--dm-self 需要本人姓名)")
        log_failure(task, "缺少 DINGTALK_MY_NAME")
        return False
    env = dict(os.environ)
    env["PATH"] = os.path.expanduser("~/.local/bin") + os.pathsep + env.get("PATH", "")
    try:
        p = subprocess.run(

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Tainted flow: 'FAIL_LOG' from os.environ.get (line 44, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/notify.py (reported line 94)May include surrounding context.

python
"""记录发送失败到本地日志(静默失败 → 有据可查)"""
    try:
        os.makedirs(os.path.dirname(FAIL_LOG), exist_ok=True)
        with open(FAIL_LOG, "a", encoding="utf-8") as f:
            f.write(f"[{_bj_now().strftime('%Y-%m-%d %H:%M:%S')}] {task} | {detail}\n")
    except OSError:
        pass

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/notify.py (reported line 164)May include surrounding context.

python
url = f"https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2?access_token=%2A%2A%2A}"

    try:
        resp = requests.post(url, json=payload, timeout=DEFAULT_TIMEOUT).json()
    except requests.exceptions.RequestException as e:
        print(f"❌ 发送异常: {e}")
        log_failure(task, f"发送异常 -> {userid}: {e}")

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/notify.py (reported line 224)May include surrounding context.

python
"msg": {"msgtype": "file", "file": {"media_id": media_id}}}
    url = f"https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2?access_token=%2A%2A%2A}"
    try:
        resp = requests.post(url, json=payload, timeout=DEFAULT_TIMEOUT).json()
    except requests.exceptions.RequestException as e:
        print(f"❌ 文件发送异常: {e}")
        log_failure(task, f"文件发送异常 -> {userid}: {e}")

Tainted flow: 'url' from requests.get (line 161, network input) → requests.post (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/notify.py (reported line 164)May include surrounding context.

python
url = f"https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2?access_token=%2A%2A%2A}"

    try:
        resp = requests.post(url, json=payload, timeout=DEFAULT_TIMEOUT).json()
    except requests.exceptions.RequestException as e:
        print(f"❌ 发送异常: {e}")
        log_failure(task, f"发送异常 -> {userid}: {e}")

Tainted flow: 'token' from requests.get (line 181, network input) → requests.post (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/notify.py (reported line 197)May include surrounding context.

python
with open(file_path, "rb") as f:
            files = {"media": (filename, f,
                     "application/vnd.openxmlformats-officedocument.presentationml.presentation")}
            resp = requests.post(
                f"https://oapi.dingtalk.com/media/upload?access_token=%2A%2A%2A}",
                data={"type": "file"}, files=files, timeout=(5, 30),
            ).json()

Tainted flow: 'url' from requests.get (line 222, network input) → requests.post (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/notify.py (reported line 224)May include surrounding context.

python
"msg": {"msgtype": "file", "file": {"media_id": media_id}}}
    url = f"https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2?access_token=%2A%2A%2A}"
    try:
        resp = requests.post(url, json=payload, timeout=DEFAULT_TIMEOUT).json()
    except requests.exceptions.RequestException as e:
        print(f"❌ 文件发送异常: {e}")
        log_failure(task, f"文件发送异常 -> {userid}: {e}")

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/notify.py (reported line 239)May include surrounding context.

python
# ------------------------------------------------------------
# 机器人「单聊私信」(真·私信,区别于上面的工作通知)
#   走新版接口 POST https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend
#   需要新版 accessToken(api.dingtalk.com 而非 oapi.dingtalk.com)
# ------------------------------------------------------------
def get_new_token(retries=TOKEN_RETRIES, timeout=DEFAULT_TIMEOUT):

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/notify.py (reported line 250)May include surrounding context.

python
last_err = None
    for attempt in range(retries + 1):
        try:
            resp = requests.post(
                "https://api.dingtalk.com/v1.0/oauth2/accessToken",
                json={"appKey": APP_KEY, "appSecret": APP_SECRET},
                timeout=timeout,

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/notify.py (reported line 250)May include surrounding context.

python
last_err = None
    for attempt in range(retries + 1):
        try:
            resp = requests.post(
                "https://api.dingtalk.com/v1.0/oauth2/accessToken",
                json={"appKey": APP_KEY, "appSecret": APP_SECRET},
                timeout=timeout,

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/notify.py (reported line 251)May include surrounding context.

python
for attempt in range(retries + 1):
        try:
            resp = requests.post(
                "https://api.dingtalk.com/v1.0/oauth2/accessToken",
                json={"appKey": APP_KEY, "appSecret": APP_SECRET},
                timeout=timeout,
            ).json()

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/notify.py (reported line 284)May include surrounding context.

python
payload = {"robotCode": APP_KEY, "userIds": [u for u in userid.split(",") if u],
               "msgKey": msg_key, "msgParam": json.dumps(param, ensure_ascii=False)}
    url = "https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend"
    try:
        resp = requests.post(
            url,

Tainted flow: 'token' from requests.post (line 271, network input) → requests.post (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/notify.py (reported line 286)May include surrounding context.

python
"msgKey": msg_key, "msgParam": json.dumps(param, ensure_ascii=False)}
    url = "https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend"
    try:
        resp = requests.post(
            url,
            headers={"x-acs-dingtalk-access-token": token, "Content-Type": "application/json"},
            data=json.dumps(payload, ensure_ascii=False).encode(),

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/notify.py (reported line 321)May include surrounding context.

python
env = dict(os.environ)
    env["PATH"] = os.path.expanduser("~/.local/bin") + os.pathsep + env.get("PATH", "")
    try:
        p = subprocess.run(
            ["dws", "chat", "+dm", "--to", to_name, "--content", content,
             "--yes", "--format", "json"],
            capture_output=True, text=True, timeout=120, env=env, cwd=WORKSPACE,

Tainted flow: 'to_name' from os.environ.get (line 313, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/notify.py (reported line 321)May include surrounding context.

python
env = dict(os.environ)
    env["PATH"] = os.path.expanduser("~/.local/bin") + os.pathsep + env.get("PATH", "")
    try:
        p = subprocess.run(
            ["dws", "chat", "+dm", "--to", to_name, "--content", content,
             "--yes", "--format", "json"],
            capture_output=True, text=True, timeout=120, env=env, cwd=WORKSPACE,