WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@th555555
Copy link

@th555555 th555555 commented Apr 2, 2025

This fixes a vulnerability where predictable random values could be exploited due to the use of a non-cryptographic RNG. The change aligns with the original implementation's security guarantees.

Fix Details

  • fix(randomString): replace ThreadLocalRandom with SecureRandom for cryptographic safety
  • Replaced ThreadLocalRandom.current() with a static SecureRandom instance to
    address potential security vulnerabilities in random string generation.
  • Maintained existing behavior for length handling and character selection.
  • SecureRandom provides cryptographically strong randomness, required for
    security-sensitive use cases (e.g., tokens, passwords).

Something similar can be found here: igniterealtime/Openfire@7ff1f73

…yptographic safety

- Replaced ThreadLocalRandom.current() with a static SecureRandom instance to
  address potential security vulnerabilities in random string generation.
- Maintained existing behavior for length handling and character selection.
- SecureRandom provides cryptographically strong randomness, required for
  security-sensitive use cases (e.g., tokens, passwords).

This fixes a vulnerability where predictable random values could be exploited
due to the use of a non-cryptographic RNG. The change aligns with the original
implementation's security guarantees.
@th555555 th555555 changed the title fix(randomString): replace ThreadLocalRandom with SecureRandom for cr… fix predictable randm string Apr 2, 2025
@th555555 th555555 changed the title fix predictable randm string fix predictable randl\om string Apr 2, 2025
@th555555 th555555 changed the title fix predictable randl\om string fix predictable random string Apr 2, 2025
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.

1 participant