[BUG]: Receipt ledger trusts comments from any installed bot, bypassing write permission checks
Maintainers usually reply within 6 days
@AyushSrivastava1818 is already working on this.
Since Nov 14, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- github-actions, typescript
- Domain
- authorization, security
Research direction
Start in src/adapters/github/receipts.ts with isTrustedReceiptAuthor() and vouched(), then follow PullRequestReceiptLedger.lookup() to see where the trust result is used. Check how hasWriteAccess() is called for human commenters, since the fix should route non-workflow bots through the same check. Done means a bot comment without write permission is not trusted, and a test covers that case; the expected workflow identity needs a maintainer decision first.
Written by the indexing model from the issue text.
Description
Bug Description
In src/adapters/github/receipts.ts, isTrustedReceiptAuthor() and vouched() treat any commenter with comment.user?.type === "Bot" as an authorized receipt author without verifying repository write permissions:
export function isTrustedReceiptAuthor(comment: CommentLike): boolean {
if ((comment.user?.type ?? "") === "Bot") return true;
return TRUSTED_ASSOCIATIONS.has((comment.author_association ?? "").toUpperCase());
}
GitPay's documented security model (lines 125–134) states:
"Only receipts written by the automation or by someone who can already spend the project's money are believed. A forged receipt withholds a payment rather than causing one, so this is griefing protection rather than theft protection — but a contributor should not be able to block someone else's payout with a comment."
While human commenters are validated against repository write permissions via hasWriteAccess(), all bot comments bypass this check completely.
Any GitHub App installed on the repository or organization with issue/PR commenting permissions (such as preview bots, triage bots, or CI reporters with read/comment permissions but without repository push permissions) is unconditionally trusted. If an installed bot echoes unvetted PR metadata, logs, or commit messages containing a receipt marker (<!-- xops-receipt:v1 key=... status=settled -->), GitPay treats the payout as AUTH_ALREADY_USED and suppresses contributor payout.
Steps to Reproduce
- In a pull request with an eligible payout, have an installed GitHub App with read/comment permissions post a comment containing:
<!-- xops-receipt:v1 key=<idempotency_key> status=settled --> - Run the GitPay settlement action.
- Observe that
PullRequestReceiptLedger.lookup()finds the comment, treats it as a vouched receipt, and aborts the payout as already settled without verifying write permissions.
Logs and Screenshots
Reproduction verifying bot bypass:
const untrustedBotComment = {
body: '<!-- xops-receipt:v1 key=0x1234567890abcdef status=settled -->',
user: { login: 'triage-preview-bot[bot]', type: 'Bot' },
author_association: 'NONE'
};
const trusted = isTrustedReceiptAuthor(untrustedBotComment);
// Returns true — trusts bot with NONE association without calling hasWriteAccess()
Suggested fix in src/adapters/github/receipts.ts:
Scope automatic receipt trust specifically to GitPay's own workflow identity (e.g. github-actions[bot] or the configured actor) rather than all installed bots. Treat other bots like human commenters by validating them with hasWriteAccess():
export function isTrustedReceiptAuthor(comment: CommentLike, expectedBotLogin?: string): boolean {
const login = comment.user?.login?.toLowerCase();
const trustedBot = (expectedBotLogin || "github-actions[bot]").toLowerCase();
if (comment.user?.type === "Bot" && login === trustedBot) {
return true;
}
return TRUSTED_ASSOCIATIONS.has((comment.author_association ?? "").toUpperCase());
}
Environment Details
- Component:
src/adapters/github/receipts.ts - Runtime: Node.js 20+ / GitHub Actions
- OS: Ubuntu runner / Linux
- Branch: main
Impact
Medium - Feature works but has issues
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 4
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 StabilityNexus/GitPay
-
[BUG]: EVM settlement does not validate an overridden chain_id against the configured CAIP-2 networkMay be free again @AyushSrivastava1818 claimed this 8 days ago, and no pull request is open. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
StabilityNexus/GitPay#91 · 1 comment ·
Maintainers usually reply within 6 days
-
[BUG]: Receipt lookup stops at the first page containing a broadcasting record, missing later settlement confirmationsPossibly taken @AyushSrivastava1818 claimed this 8 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
StabilityNexus/GitPay#90 · 1 comment ·
Maintainers usually reply within 6 days
All issues in StabilityNexus/GitPay
Similar issues
-
[BUG]: Shared links drop the configured basePath on GitHub PagesPossibly taken @anshulchikhale30-p claimed this today. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 comment ·
Maintainers usually reply within 1 day
-
Add: GTrekkerOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
Maintainers usually reply within 1 day
-
area: ui Bug Payload OSS
Difficulty 1/5 Under an hour Newbie friendliness 88/100
payloadcms/payload#19839 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day