subject-checksums is not subject to the 1024-subject limit
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- security
Research direction
Start in src/subject.ts by reading getSubjectFromChecksumsString and the existing MAX_SUBJECT_COUNT checks for other subject inputs. Add a regression test based on the 1,100-record reproduction and check that it throws the existing “Too many subjects specified” error; done means checksum input over 1024 is rejected while valid input within the limit still works.
Written by the indexing model from the issue text.
Description
Summary
The documented limit of 1024 subjects is enforced for subject-path and for subjects discovered from $GITHUB_ARTIFACTS_LIST, but not for subject-checksums. A checksums file with more than 1024 valid records is accepted and produces an oversized attestation.
Details
README ("Attestation Limits") says: "No more than 1024 subjects can be attested at the same time."
MAX_SUBJECT_COUNT is checked in two places in src/subject.ts, and getSubjectFromChecksumsString has no counter of its own:
- discovered subjects:
if (discovered.length > MAX_SUBJECT_COUNT) - glob results:
if (files.length >= MAX_SUBJECT_COUNT) - checksums: no equivalent check
The only bound on that path is the file-size cap MAX_SUBJECT_CHECKSUM_SIZE_BYTES = 512 * MAX_SUBJECT_COUNT (512 KiB). A minimum-length record (<64 hex> <name>) is ~68 bytes, so a 512 KiB file carries roughly 7,700 subjects — over 7x the documented limit. The constant being expressed as "512 bytes × 1024 subjects" suggests the count limit was meant to be the real bound.
#447's commit message says discovered subjects "respect the same MAX_SUBJECT_COUNT (1024) limit applied to glob and checksum inputs", which overstates it for checksums. (#53, which introduced the limit, only ever applied it after subject-path glob resolution.)
Reproduction
const lines = Array.from({ length: 1100 }, (_, i) => `${'a'.repeat(64)} art-${i}`)
const subjects = await subjectFromInputs({ ...blank, subjectChecksums: lines.join('\n') })
// subjects.length === 1100 (no throw)
Why it matters
Whatever consumes the statement (the attestation API, verifiers, downstream tooling) has no reason to cope with more than the documented maximum, and the caller gets no signal that they crossed it. subject-path fails fast with Too many subjects specified (>1024), so behaviour is inconsistent per input.
Suggested fix
Apply the same MAX_SUBJECT_COUNT check inside getSubjectFromChecksumsString, failing with the existing "Too many subjects specified" message.
- Dominant language
- TypeScript
- Stars
- 187
- Forks
- 65
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 8
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from actions/attest
-
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 75/100
Maintainers usually reply within 1 day
Similar issues
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
db-ux-design-system/core-web#8856 ·
Maintainers usually reply within 1 day
-
'!' breaking change is lost when the commit also has an empty BREAKING CHANGE footerPossibly taken @wittdennis claimed this today. Openpriority: p3 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
googleapis/release-please#2971 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
🛠️ dette technique
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
betagouv/mon-entreprise#4752 · 1 comment ·
Maintainers usually reply within 5 days