Unpinned floating tags (e.g. `v4`) on immutable Actions are not flagged by `actions/unpinned-tag`
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 领域
- security
调研方向
阅读 actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql 和 actions/ql/lib/codeql/actions/security/UseOfUnversionedImmutableAction.qll,从 isImmutableAction 和现有的 SemVer 谓词开始。完成的标准是:完整的 vX.Y.Z 标签和完整的 SHA 仍然豁免,而 vX 和 vX.Y 等浮动引用会被报告,并包含所需的变更说明。
由索引模型根据 Issue 内容生成。
描述
Description of the issue
The actions/unpinned-tag query (actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql) exempts any Action on the immutable-actions allow list from the unpinned-tag warning, regardless of the ref used. The exclusion is version-independent:
not exists(UsesStep step | uses = step and isImmutableAction(step, nwo))
and isImmutableAction (actions/ql/lib/codeql/actions/security/UseOfUnversionedImmutableAction.qll) only checks membership in immutableActionsDataModel(nwo); it never inspects the version.
Why this is a gap
GitHub's immutability guarantee only applies to fully-expanded SemVer release tags (vX.Y.Z) and full commit SHAs. Floating tags such as v4, v4.0 and main remain mutable: maintainers move them to the latest matching release, so they can change under a consumer exactly like any other tag. See Using immutable releases and tags to manage your action's releases.
As a result, a reference like actions/checkout@v2 is flagged by neither query:
UnpinnedActionsTagskips it becauseactions/checkoutis on the immutable list.UnversionedImmutableActionskips it because itsisSemVerpredicate accepts a bare major tag likev2.
So a genuinely mutable floating tag on an immutable Action goes unwarned.
Suggested direction
Narrow the exemption so an immutable Action is only exempt when pinned to a full vX.Y.Z (or a SHA), for example:
not (isImmutableAction(step, nwo) and isFullSemVer(version))
with an isFullSemVer stricter than the current isSemVer (which also matches floating vX and vX.Y). This would need care because the immutable-action model is shared with the experimental UnversionedImmutableAction query, and it would increase alert volume for consumers pinning immutable Actions to floating major tags, so it deserves its own change note and review.
Filed as a follow-up to #22409 (which is scoped to the trusted-owner allow list and does not address this).
- 主要语言
- CodeQL
- 星标
- 10.1k
- 派生
- 2.1k
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 143
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/codeql 的其他 Issue
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 70/100
-
false-positive javascript
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
false-positive
难度 2/5 1-3 小时 新手友好度 70/100
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
canonical/paas-charm#368 · 1 条评论 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 75/100
palladius/rails8-app-on-gcp#142 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
StevenBlack/hosts#3256 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
corsairdev/corsair#1764 ·
-
oblt-aw/detector/security
难度 2/5 1-3 小时 新手友好度 70/100