Skip to content

Reject empty QR codes to close signup auth bypass#330

Merged
MichaelZhao21 merged 2 commits intohackutd:masterfrom
balebbae:master
Apr 29, 2026
Merged

Reject empty QR codes to close signup auth bypass#330
MichaelZhao21 merged 2 commits intohackutd:masterfrom
balebbae:master

Conversation

@balebbae
Copy link
Copy Markdown
Contributor

Description

The QR-code judge signup flow (POST /api/qr/add) authorizes attendees by comparing a submitted code
against options.QRCode (or options.TrackQRCodes[track]). Both default to "" — so before an admin
generates a QR (or for any track that's never had one set), submitting {"code": ""} satisfies "" != "" → false and a judge is created with attacker-controlled name/email. Same bypass applies to
/api/qr/check and /api/qr/check/:track.

Fixes #[Issue]

Fix: reject empty values explicitly at all three comparison sites in AddJudgeFromQR, CheckQRCode,
and CheckTrackQRCode.

Type of Change

Delete options that do not apply:

  • Bug fix (change which fixes an issue)

Is this a breaking change?

  • Yes
  • No

@balebbae balebbae requested a review from MichaelZhao21 April 29, 2026 21:03
Copy link
Copy Markdown
Contributor

@MichaelZhao21 MichaelZhao21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm--for context this was found at LA Hacks by https://devpost.com/software/codebreaker-la.

@MichaelZhao21 MichaelZhao21 merged commit 1c8e1c9 into hackutd:master Apr 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants