Skip to content
Report library
Purpose / Other

Lark Contact Skill Security Audit

What the author says it does (original text)

飞书 / Lark 通讯录:按姓名 / 邮箱解析成 open_id,或按 open_id 反查姓名 / 部门 / 邮箱 / 联系方式 / 个人状态 / 签名,以及按关键词搜索当前用户可见的机器人 / 智能体(agent)。当用户提到一个名字要下一步发消息 / 排日程,或拿到 open_id 想查具体信息时使用。不负责部门树遍历、按部门列员工、组织架构图,这类需求走原生 OpenAPI。

Independent security check

Security risks found

Files checked
4
Risks found
1
Could it run dangerous commands?Looks for programs run straight after downloading, remote control of your computer, and hidden commands.No risks found
Could it expose your files or keys?Looks for uploads of files containing passwords or keys, and keys written directly in the code.Risks found: 1
Medium risk

Keyword-free filters can enumerate coworkers and expose unnecessary personal and relationship data

Source references: 5
What we found

The documentation permits Boolean-filter-only searches without a name or email, and its example lists every departed coworker the user has chatted with. Results may also include personal email, department, signature, account status, chat history indication, and a P2P chat ID. Even within the account's visibility, this can exceed what is needed to resolve one contact.

Why this matters

If an agent uses a broad search for an ambiguous request, terminal output, model context, or subsequent replies may expose coworkers' contact details, organizational affiliation, departure status, and communication relationships. Batch lookup of up to 100 open IDs increases the possible exposure in one operation.

The documentation explicitly permits searches with only Boolean filters—without a name, email, or ID—and provides an executable example that enumerates all former colleagues the user has chatted with. The output contract includes personal/work email, department, signature, account status, P2P chat ID, and chat relationship, potentially exceeding what is needed to resolve one contact. This risk arises if the agent uses the broad filter for a vague request or on its own; results remain limited to the current user's visibility. Users can ask the author to disable filter-only enumeration by default, minimize returned fields, and require confirmation of scope and purpose before bulk queries.

references/lark-contact-search-user.md:14In the instructionsOpen original file
`--query` / `--queries` / `--user-ids` / bool filter 至少传一个。bool filter 显式传 `=false` 会报错——不传等于不过滤。
Show 4 other places
references/lark-contact-search-user.md:46In the instructionsOpen original file
# filter-only 枚举:列出所有"聊过天的离职同事"(无关键词)lark-cli contact +search-user --has-chatted --left-organization```
references/lark-contact-search-user.md:8In the instructionsOpen original file
- ✅ 已知姓名 / 邮箱 / 「聊过的人」想找出 open_id- ✅ 已知一组 open_id 想批量校验或回填字段(`--user-ids`,最多 100,支持 `me`)- ✅ 按聊天关系 / 在职状态 / 租户边界 / 企业邮箱等维度筛选员工- ❌ 已知 open_id 想发消息 → 直接走 `lark-im`,不经过本命令
references/lark-contact-search-user.md:100In the instructionsOpen original file
| `localized_name` | string | 按 `--lang` / brand 选出的展示名 | 始终非空(兜底为 open_id) || `email` | string | 个人邮箱 | 可能为空 || `enterprise_email` | string | 企业邮箱 | 可能为空 || `is_activated` | bool | 是否已激活飞书账号(未激活也可投递消息,但用户可能看不到) | 可能 false || `is_cross_tenant` | bool | 是否跨租户用户(同公司=false,外部联系人=true) | — || `p2p_chat_id` | string | 与当前用户的 P2P 会话 ID(`oc_...`);空表示从未私聊过。可作为接受 `--chat-id` 的 IM 命令的输入 | 可能为空 || `has_chatted` | bool | `p2p_chat_id != ""` 的派生字段 | — || `department` | string | 部门路径,服务端可能用 `-` 拼层级,层级数不固定。**按可子串匹配的字符串处理** | 可能为空 || `signature` | string (optional) | 用户个性签名;空时字段不出现 | 可能不出现 || `chat_recency_hint` | string | 最近联系的提示文案,仅供展示 | 可能为空 |
SKILL.md:63In the instructionsOpen original file
- **41050 / Permission denied** 受当前身份的可见范围限制(三条命令都可能遇到)。细节见 [`lark-shared`](../lark-shared/SKILL.md)。- **跨租户用户**(`is_cross_tenant=true`)多数业务字段为空字符串,这是飞书可见性规则,下游做空值兜底。- **ID 类型**:`+get-user` 可通过 `--user-id-type` 使用 `open_id`、`union_id` 或 `user_id`;`+search-user` 使用用户 open_id;`+search-bot` 不支持按 ID 查询,它按关键词搜索并返回机器人 open_id。
Could it delete files or keep running?Looks for broad file deletion, disk overwrites, and programs set to start automatically.No risks found
Could it bypass safety checks?Looks for skipped website security checks, excessive file access, or actions that skip your approval.No risks found
Could it mislead the AI or hide text?Checks the skill instructions for requests to ignore you, influence the report, or hide text in invisible characters.No risks found
Could it change links or payment recipients without asking?Looks for forced referral or payment changes combined with instructions to hide the change.No risks found

Inside this skill

5 instruction sections

This Skill depends on `lark-cli` and queries the Lark directory as the current user or bot identity. Those identity paths are separate, and results are limited by that identity's visibility.

View source
SKILL.md:6In the instructionsOpen original file
metadata:  requires:    bins: ["lark-cli"]  cliHelp: "lark-cli contact --help"---
SKILL.md:13In the instructionsOpen original file
**user 身份和 bot 身份是两条完全独立的路径**。先确定当前身份,再按下表选命令:
SKILL.md:63In the instructionsOpen original file
- **41050 / Permission denied** 受当前身份的可见范围限制(三条命令都可能遇到)。细节见 [`lark-shared`](../lark-shared/SKILL.md)。- **跨租户用户**(`is_cross_tenant=true`)多数业务字段为空字符串,这是飞书可见性规则,下游做空值兜底。

A user identity can search people by name, email, or phone number and can retrieve records for up to 100 open IDs, including names, emails, departments, account status, chat identifiers, and signatures.

View source
references/lark-contact-search-user.md:18In the instructionsOpen original file
|---|---|| `--query <text>` | 关键词(姓名 / 邮箱 / 手机号),≤ 50 rune || `--queries <csv>` | 多个关键词并行搜,**最多 20 条**;与 `--query` / `--user-ids` 互斥;输出新 shape(见下) || `--user-ids <csv>` | open_id 列表,≤ 100;支持 `me` 表示自己;与 `--query` 同传时把搜索范围限定在该集合 || `--has-chatted` | 仅搜聊过天的 |
references/lark-contact-search-user.md:98In the instructionsOpen original file
|---|---|---|---|| `open_id` | string | 稳定标识,后续命令的输入 | 始终非空 || `localized_name` | string | 按 `--lang` / brand 选出的展示名 | 始终非空(兜底为 open_id) || `email` | string | 个人邮箱 | 可能为空 || `enterprise_email` | string | 企业邮箱 | 可能为空 || `is_activated` | bool | 是否已激活飞书账号(未激活也可投递消息,但用户可能看不到) | 可能 false || `is_cross_tenant` | bool | 是否跨租户用户(同公司=false,外部联系人=true) | — || `p2p_chat_id` | string | 与当前用户的 P2P 会话 ID(`oc_...`);空表示从未私聊过。可作为接受 `--chat-id` 的 IM 命令的输入 | 可能为空 || `has_chatted` | bool | `p2p_chat_id != ""` 的派生字段 | — || `department` | string | 部门路径,服务端可能用 `-` 拼层级,层级数不固定。**按可子串匹配的字符串处理** | 可能为空 || `signature` | string (optional) | 用户个性签名;空时字段不出现 | 可能不出现 || `chat_recency_hint` | string | 最近联系的提示文案,仅供展示 | 可能为空 |

The Skill explicitly requires user selection when multiple matches exist and the next action would send a message or invite someone; it says not to choose the first result automatically.

View source
SKILL.md:50In the instructionsOpen original file
搜索命中多条且后续操作有副作用(发消息、邀请会议等),把候选列给用户挑;不要擅自选第一条。
references/lark-contact-search-user.md:76In the instructionsOpen original file
搜常见姓名常返回多条同名结果。后续操作若有副作用(发消息、邀请会议等),把候选列给用户挑;**不要擅自选**。筛选信号(可信度从高到低):`chat_recency_hint`(近期联系过) > `enterprise_email` 前缀 > `department` 关键词。`localized_name` 同名时无区分作用。

The Skill can also search bots or agents visible to the current user and return their open ID, direct-chat ID, tenant identifier, and description. This requires the `search:bot` permission.

View source
references/lark-contact-search-bot.md:3In the instructionsOpen original file
按关键词搜索当前用户可见的机器人。仅支持 user 身份,需要 `search:bot` 权限。
references/lark-contact-search-bot.md:31In the instructionsOpen original file
|---|---|---|---|| `open_id` | string | 机器人 ID | 始终非空 || `name` | string | 机器人名称 | 空字符串 || `description` | string | 机器人简介 | 字段省略 || `chat_id` | string | 与机器人的单聊 ID | 空字符串 || `enable_join_group` | bool | 是否允许加入群聊 | — || `is_agent` | bool | 是否是智能体 | — || `tenant_id` | string | 租户标识 | 字段省略 || `match_segments` | string[] | 命中的文本片段 | 无命中时为 `[]` |
Start here · InstructionsSKILL.md
lark-contact
Lines connect the instruction file to its sections, not an observed execution order. Select a section to read the source.

File reference map

References: 3
Files making referencesReferenced content
Lines show actual file references, not execution order. Select a node to highlight its connections and inspect the files and source locations. Dashed lines include files that still need locating.
Files and check records4 files

Coverage and gaps

Content covered in each file

These are the source ranges included in this check, not a guarantee that every issue has been resolved.

  • SKILL.mdFull text included
  • references/lark-contact-get-user.mdFull text included
  • references/lark-contact-search-bot.mdFull text included
  • references/lark-contact-search-user.mdFull text included

This report is for the version above. We read the available code and instructions without running the skill or checking extra packages it installs. This is not a promise of safety: a different version or setup may behave differently.

  • SKILL.mdInstructions
  • references/lark-contact-get-user.mdSupporting file
  • references/lark-contact-search-bot.mdSupporting file
  • references/lark-contact-search-user.mdSupporting file

Operations mentioned in code and instructions

Run commands
SKILL.md:35In the instructionsOpen original file
```bashlark-cli contact +search-user --query "张三" --has-chatted --as user
SKILL.md:42In the instructionsOpen original file
```bashlark-cli schema contact.user_profiles.batch_query
SKILL.md:56In the instructionsOpen original file
```bashlark-cli contact +search-bot --query '会议助手' --as user
Lines read
277
File checksum (to compare versions)
c4aa6c9bdd0a77ca91e3721198a8c4faa95aee250f69841765ca50fedfc77e39