跳转到正文
报告库
用途分类 / 其他用途

Golang Samber Lo Skill 安全审计

作者说它能做什么(原文)

Functional programming helpers for Golang using samber/lo — 500+ type-safe generic functions for slices, maps, channels, strings, math, tuples, and concurrency (Map, Filter, Reduce, GroupBy, Chunk, Flatten, Find, Uniq, etc.). Core immutable package (lo), concurrent variants (lo/parallel aka lop), in-place mutations (lo/mutable aka lom), lazy iterators (lo/it aka loi for Go 1.23+), and experimental

第三方安全检查结论

发现安全风险

已检查文件
5
发现的风险
2
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。发现 1 项风险
低风险

安装命令会下载第三方模块并更改项目依赖状态

原文依据:2 处
发现了什么

Skill 直接建议运行 `go get github.com/samber/lo`。这是正常的 Go 依赖安装行为,但它会访问模块来源并通常修改 go.mod/go.sum,而不是仅提供离线文档。

为什么需要注意

执行后,项目构建将信任并编译所解析版本的第三方源代码;未审查的版本变化也可能影响构建可复现性或引入供应链风险。材料没有固定具体版本,也不能证明下载内容的安全性。

这段代码的正常用途

这是安装章节中与 Skill 声明用途一致的标准 Go 模块添加命令,并非隐藏脚本或自动安装钩子。只有用户或代理实际执行时才会联网获取第三方模块,并可能更新项目的 go.mod/go.sum;材料未表明命令已执行。用户可要求先确认模块版本、审查依赖变更,并限制未经批准的网络访问或文件写入。

这项判断针对展示的代码和适用条件,不表示风险已经实际发生。
SKILL.md:52来自说明文档打开原文件
## Installation```bashgo get github.com/samber/lo```
查看另外 1 个位置
SKILL.md:13来自说明文档打开原文件
    homepage: https://github.com/samber/cc-skills-golang    requires:      bins:        - go    install: []    skill-library-version: "1.53.0"
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。未发现风险
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 1 项风险
中风险

Skill 获得了与其 Go 辅助用途无关的宽泛 Git 命令权限

原文依据:3 处
发现了什么

允许工具包含不受子命令限制的 `Bash(git:*)`。该 Skill 的声明用途是 Go 集合转换和 samber/lo 采用,并未给出需要推送、重置、清理或删除分支等 Git 操作的工作流。

为什么需要注意

如果代理在 Skill 激活时错误使用或受项目内容诱导使用该权限,它可以改写提交历史、删除未提交工作,或在已有凭据和远端配置允许时向远端推送。现有材料没有显示这些操作已经发生。

该 Skill 声明的用途是使用 samber/lo 进行 Go 集合转换,但工具权限允许执行任意 git 子命令。若代理调用该权限,可能推送代码、硬重置、清理文件或删除分支,影响用户文件和远程仓库;所提供内容没有说明这些操作为何必要或如何限制。用户可要求作者移除 Git 权限,或仅允许明确需要的只读子命令。

SKILL.md:2来自说明文档打开原文件
---name: golang-samber-lodescription: "Functional programming helpers for Golang using samber/lo — 500+ type-safe generic functions for slices, maps, channels, strings, math, tuples, and concurrency (Map, Filter, Reduce, GroupBy, Chunk, Flatten, Find, Uniq, etc.). Core immutable package (lo), concurrent variants (lo/parallel aka lop), in-place mutations (lo/mutable aka lom), lazy iterators (lo/it aka loi for Go 1.23+), and experimental SIMD (lo/exp/simd). Apply when using or adopting samber/lo, when the codebase imports github.com/samber/lo, or when implementing functional-style data transformations in Go. Not for streaming pipelines (→ See `samber/cc-skills-golang@golang-samber-ro` skill)."user-invocable: true
查看另外 2 个位置
SKILL.md:18来自说明文档打开原文件
    skill-library-version: "1.53.0"allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__*paths:
SKILL.md:3来自说明文档打开原文件
name: golang-samber-lodescription: "Functional programming helpers for Golang using samber/lo — 500+ type-safe generic functions for slices, maps, channels, strings, math, tuples, and concurrency (Map, Filter, Reduce, GroupBy, Chunk, Flatten, Find, Uniq, etc.). Core immutable package (lo), concurrent variants (lo/parallel aka lop), in-place mutations (lo/mutable aka lom), lazy iterators (lo/it aka loi for Go 1.23+), and experimental SIMD (lo/exp/simd). Apply when using or adopting samber/lo, when the codebase imports github.com/samber/lo, or when implementing functional-style data transformations in Go. Not for streaming pipelines (→ See `samber/cc-skills-golang@golang-samber-ro` skill)."user-invocable: true
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

8 个说明模块

该 Skill 是 samber/lo 的 Go 编程指南,指导代理在标准库、不可变转换、并行、原地修改、惰性迭代和实验性 SIMD 之间选择;其主要行为是提供建议和生成或修改 Go 代码。

查看原文
SKILL.md:23来自说明文档打开原文件
**Persona:** You are a Go engineer who prefers declarative collection transforms over manual loops. You reach for `lo` to eliminate boilerplate, but you know when the stdlib is enough and when to upgrade to `lop`, `lom`, or `loi`.# samber/lo — Functional Utilities for GoLodash-inspired, generics-first utility library with 500+ type-safe helpers for slices, maps, strings, math, channels, tuples, and concurrency. Zero external dependencies. Immutable by default.

采用该库时,Skill 给出的安装步骤会从 GitHub 模块路径下载依赖,并更新当前 Go 项目的依赖清单;清单没有自动安装钩子。

查看原文
SKILL.md:13来自说明文档打开原文件
    homepage: https://github.com/samber/cc-skills-golang    requires:      bins:        - go    install: []    skill-library-version: "1.53.0"
SKILL.md:52来自说明文档打开原文件
## Installation```bashgo get github.com/samber/lo```

Skill 明确说明 mutable 包会原地更改切片、可能丢失原数据且不适合并发访问,并要求仅在性能分析确认后使用。这降低了示例被误当成默认安全转换的风险。

查看原文
references/package-guide.md:88来自说明文档打开原文件
**Characteristics:**- Modifies the input slice — callers must expect side effects- `lom.Filter` shortens the slice (removes non-matching elements in-place)- `lom.Map` transforms elements in-place (preserves length)- Uses Fisher-Yates for `Shuffle`- Not safe for concurrent access to the source slice**Use when:**- `go tool pprof -alloc_objects` confirms allocation pressure from `lo.Filter`/`lo.Map`- Working with very large slices where GC pressure is measurable- You explicitly want to modify the source and won't need the original
references/advanced-patterns.md:131来自说明文档打开原文件
// After — zero allocations, modifies in-placeevents = lom.Filter(events, isValid)// Warning: 'events' is now modified. Original data is lost.```

Skill 对高风险或易误用的 API 给出边界:生产请求路径不应使用会 panic 的 Must,实验性 SIMD 应经过基准测试并固定版本。

查看原文
SKILL.md:142来自说明文档打开原文件
| Assuming `lo.Filter` modifies the input | `lo` is immutable by default — it returns a new slice | Use `lom.Filter` if you explicitly need in-place mutation || Using `lo.Must` in production code paths | `Must` panics on error — fine in tests and init, dangerous in request handlers | Use the non-Must variant and handle the error || Chaining many eager transforms on large data | Each step allocates an intermediate slice | Use `loi` (lazy iterators) to avoid intermediate allocations |
references/package-guide.md:150来自说明文档打开原文件
## `lo/exp/simd` — Experimental SIMDSIMD (Single Instruction Multiple Data) optimized operations for numeric types on amd64.**Use when:** Bulk numeric operations after benchmarking confirms the bottleneck. Very specialized.**Warning:** This package is experimental and not covered by semver stability guarantees, so its API may break between minor versions. Do not use in production without version pinning.
从这里开始 · 工作说明SKILL.md
golang-samber-lo
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。

文件引用关系图

3 处引用
哪些文件发起引用引用了什么
连线表示真实的文件引用,不是运行顺序。点击节点可高亮相关连线,并查看具体文件和原文位置。虚线表示还有文件需要定位。
文件与检查记录5 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文
  • references/advanced-patterns.md已纳入全文
  • references/api-reference.md已纳入全文
  • references/package-guide.md已纳入全文
  • evals/evals.json已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
  • evals/evals.json配套文件
  • references/advanced-patterns.md配套文件
  • references/api-reference.md配套文件
  • references/package-guide.md配套文件

代码和说明中提到的操作

连接外部网站
SKILL.md:12来自说明文档打开原文件
    emoji: "🧰"    homepage: https://github.com/samber/cc-skills-golang    requires:
SKILL.md:31来自说明文档打开原文件
- [github.com/samber/lo](https://github.com/samber/lo)- [lo.samber.dev](https://lo.samber.dev)
SKILL.md:32来自说明文档打开原文件
- [github.com/samber/lo](https://github.com/samber/lo)- [lo.samber.dev](https://lo.samber.dev)- [pkg.go.dev/github.com/samber/lo](https://pkg.go.dev/github.com/samber/lo)
运行命令
SKILL.md:18来自说明文档打开原文件
    skill-library-version: "1.53.0"allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__*paths:
SKILL.md:54来自说明文档打开原文件
```bashgo get github.com/samber/lo
读取了多少行
1,139
文件校验值(用于核对版本)
e0867665ea0411455c73170766e496d46cc80d4cfd9713d7bfb0dbec3d802a73