Skip to content

Important: sponsored track module_id collision (track_id >= 1000) #23

@0xdevcollins

Description

@0xdevcollins

Severity: Important

// contract.rs:676
let derived_module_id = hackathon_id * 1000 + track_id as u64;

Track 1000 of hackathon X collides with track 0 of hackathon X+1. Currently no assertion bounds track_id.

Fix

  • Assert track_id < 1000 and return InvalidTrackId (new error)
  • OR use a larger multiplier: hackathon_id * (1 << 32) + track_id as u64
  • Long-term: use a hash-derived pool_id that doesn't rely on numeric encoding

Tests

  • 1000th track on a hackathon → reject
  • 999th track + first track on next hackathon → distinct pool_ids

Metadata

Metadata

Assignees

No one assigned

    Labels

    audit-findingSurfaced during internal audit / reviewbugSomething isn't workingsecuritySecurity-sensitive issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions