jenkinsci / jenkinsci/support-core-plugin

Generated pseudonyms are exhaustible and not reproducible

Open
#985 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
19
Forks
77
Avg merge
17h 53m
Merged PRs (30d)
3

Description

`ContentMappings` pseudonyms are an `adjective_noun` pair from `wordnet-random-name`, so only 611 * 2407 = 1,470,677 distinct values exist.

`RandomNameGenerator.next()` walks a cursor - `pos = Math.abs(pos + prime) % size`, with `gcd(prime, size) == 1` - so it is an exact permutation: collision-free until it exhausts the space, then it repeats in the same order. Checked against the shipped jar: `size=1470677`, `prime=3263443`, 1,470,677 distinct names, first repeat at draw 1,470,678.

Two consequences:

1. **Tables larger than 1.47M entries reuse pseudonyms**, and nothing checks `getReplacement()` for uniqueness. Two distinct originals then render identically in a bundle, and reversing a pseudonym through the mappings table is ambiguous. Tables that large do occur in practice.

2. **Pseudonyms are not reproducible.** The cursor is seeded from `System.currentTimeMillis()`, so the same original gets a different pseudonym on another instance, or after the mappings file is lost.

On severity: a collision leaks *less* information, not more, so this is a correctness bug in the promise that one pseudonym identifies one thing - not a security issue.

Contributor guide

Open the contributing guide

Research direction

Start with ContentMappings and RandomNameGenerator, then compare their behavior with the shipped jar described in the issue. Define tests for uniqueness beyond 1,470,677 entries and for stable output across instances or after the mappings file is lost. Done means the pseudonym mapping remains unambiguous and reproducible.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.