Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Safe Outputs Conformance] SEC-005: Cross-repo target-repo field flagged without allowlist check

未关闭 适合新手
#71,058 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
67/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
github-actions, shell

调研方向

阅读 scripts/check-safe-outputs-conformance.sh,尤其是 check_cross_repo,并检查 actions/setup/js/unified_session_payload.cjs 和 actions/setup/js/unified_session_render.cjs 中的 targetRepo 映射。确认这些文件只传递或显示元数据,然后在映射附近添加文档说明的 SEC-005 豁免。运行 bash scripts/check-safe-outputs-conformance.sh,并确认两个文件都通过。

由索引模型根据 Issue 内容生成。

描述

automated conformance safe-outputs security
Conformance Check Failure

Check ID: SEC-005
Severity: HIGH
Category: Security

Problem Description

The conformance checker flags two files for supporting a target-repo-shaped field without a visible allowlist validation call:

  • actions/setup/js/unified_session_payload.cjs (line ~453): maps targetRepo/target_repo into the unified session payload field extraction table.
  • actions/setup/js/unified_session_render.cjs (line ~276): includes targetRepo in a list of fields rendered into a human-readable session log line.

Both usages are read-only: they copy an already-resolved targetRepo value from session metadata into an observability payload or log line for display. Neither file makes a GitHub API call against a different repository, so SEC-005s allowlist requirement (allowed.*[Rr]epos, validateTargetRepo, checkAllowedRepo) does not apply to them the way it does to a true cross-repo write handler.

Affected Components
  • Files: actions/setup/js/unified_session_payload.cjs, actions/setup/js/unified_session_render.cjs
  • Check: scripts/check-safe-outputs-conformance.sh function check_cross_repo (SEC-005)
<b>Current vs Expected Behavior</b>
Current Behavior

The SEC-005 regex (\btarget-repo\b|\btargetRepo\b|\btarget_repo\b) matches any file that merely references a targetRepo identifier, including pure display/metadata-mapping code, and then requires an allowlist-check pattern in that same file or logs a HIGH failure.

Expected Behavior

SEC-005 is intended to catch handlers that use target-repo to perform a cross-repository GitHub API write without validating against allowed-repos. Pure metadata pass-through/rendering code that never calls the GitHub API should not trip this check. The script already supports a documented exemption via an @safe-outputs-exempt SEC-005 annotation for exactly this situation.

Remediation Steps
  1. Confirm unified_session_payload.cjs and unified_session_render.cjs never pass targetRepo to an octokit call or any cross-repo write path (only read/display it).
  2. If confirmed, add a documented exemption comment (// @safe-outputs-exempt SEC-005: <reason>) near the targetRepo field mapping in both files, explaining that the field is display/telemetry-only metadata, not a cross-repo write target.
  3. If either file is later changed to perform an actual cross-repo API call using this field, remove the exemption and add a real allowlist check at that call site instead.
Verification

After remediation, verify the fix by running:

bash scripts/check-safe-outputs-conformance.sh

SEC-005 should report PASS for both files.

References
  • Safe Outputs Specification: docs/src/content/docs/specs/safe-outputs-specification.md
  • Conformance Checker: scripts/check-safe-outputs-conformance.sh
  • Run: §39729823556
  • Date: 2026-10-22

Generated by ✅ Daily Safe Outputs Conformance Checker · claude · agent · 132.9 AIC · ⌖ 0.552 AIC · ⊞ 5.4K · ◷

  • expires on Oct 22, 2026, 9:54 PM UTC-08:00
主要语言
Go
星标
5.4k
派生
596
平均合并
3 小时 40 分钟
30 天内合并 PR
830

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/gh-aw 的其他 Issue

查看 github/gh-aw 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。