Unpinned floating tags (e.g. `v4`) on immutable Actions are not flagged by `actions/unpinned-tag`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- security
Hướng nghiên cứu
Đọc actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql và actions/ql/lib/codeql/actions/security/UseOfUnversionedImmutableAction.qll, bắt đầu với isImmutableAction và predicate SemVer hiện có. Được coi là hoàn tất khi các tag vX.Y.Z đầy đủ và SHA đầy đủ vẫn được miễn, trong khi các tham chiếu trôi nổi như vX và vX.Y bị báo cáo, kèm theo ghi chú thay đổi bắt buộc.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- CodeQL
- Star
- 10.1k
- Fork
- 2.1k
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 134
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/codeql
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
C#: cs/simplifiable-boolean-expression false positive on Nullable<bool> compared with a literal Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
false-positive
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
false-positive
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Tất cả issue của github/codeql
Issue tương tự
-
Product: Azure Policy :shield: Topic: Diagnostic Settings :test_tube: Topic: Policy :pencil:
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
Azure/Azure-Landing-Zones#4283 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
MystenLabs/MemWal#979 · 1 bình luận ·
-
Claiming namespace [Tafanee] Đang mởnamespace operations
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
EclipseFdn/open-vsx.org#13384 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
documentation
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
inmanta/inmanta-core#10835 ·