frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

NPM UUID's random number gen contains shared mutable state bug since 3 weeks

2•jbverschoor•59m ago
(copied from the other thread)

Changed 3 weeks ago:

uuid/src/rng.ts : the random array is const. Every call will share the same random number. Subsequent call will update your old random code, so if you generated something important... good luck

The old code used to do a slice() which creates a new copy.

https://github.com/uuidjs/uuid/blob/e1f42a354593093ba0479f0b... became

https://github.com/uuidjs/uuid/blob/f2c235f93059325fa43e1106...

Welp.. time to patch and update everything again. Another day, another npm-package headache. Very odd()

Attack vector: call the rng(), and send the result somewhere. You now have now overwritten someone else's "random number" and know about it. The fun things you can do with those numbers!

Comments

jbverschoor•58m ago
(previously https://news.ycombinator.com/item?id=48060054 )

Didn't actually want to write a test myself.. but I miss Claudia confirmed it. Pretty concerning.

Synchronous / serial calls:

   import rng from './rng';
   
   const a = rng();
   console.log('a after first call: ', Array.from(a));
   
   const b = rng();
   console.log('a after second call:', Array.from(a));
   console.log('b after second call:', Array.from(b));
   
   console.log('a === b (same reference)?    ', a === b);
   console.log('a equals b (same contents)?  ', a.every((v, i) => v === b[i]));

output:

   a after first call:  [
     101, 193, 125,  19, 142,
     136, 181, 140, 209, 224,
     176, 153, 179, 248, 246,
     166
   ]
   a after second call: [
       4,  29, 48, 215, 162,  60,
      64,  23, 78, 137,   2, 186,
     230, 249, 70, 224
   ]
   b after second call: [
       4,  29, 48, 215, 162,  60,
      64,  23, 78, 137,   2, 186,
     230, 249, 70, 224
   ]
   a === b (same reference)?     true
   a equals b (same contents)?   true
   
and aynchronous calls:

   import rng from './rng';
   
   async function getId() {
      const bytes = rng();
      await new Promise(r => setTimeout(r, 0)); // yield to the event loop
      return Array.from(bytes);
   }
   
   const [id1, id2] = await Promise.all([getId(), getId()]);
   console.log('id1:', id1);
   console.log('id2:', id2);
   console.log('identical?', id1.every((v, i) => v === id2[i]));

output:

   id1 captured:  [
      61, 116, 151,  35, 153,
      75, 105,  15,  59, 235,
     162, 215, 224, 115,  31,
     122
   ]
   id2 captured:  [
      13,  3,  84,  28, 22, 176,
     160, 70,  67, 246,  1,  37,
      38, 61, 171,  23
   ]
   id1 after await: [
      13,  3,  84,  28, 22, 176,
     160, 70,  67, 246,  1,  37,
      38, 61, 171,  23
   ]
   id2 after await: [
      13,  3,  84,  28, 22, 176,
     160, 70,  67, 246,  1,  37,
      38, 61, 171,  23
   ]
   ---
   final id1: [
      13,  3,  84,  28, 22, 176,
     160, 70,  67, 246,  1,  37,
      38, 61, 171,  23
   ]
   final id2: [
      13,  3,  84,  28, 22, 176,
     160, 70,  67, 246,  1,  37,
      38, 61, 171,  23
   ]
   identical? true
jbverschoor•50m ago
Seems to be "safe" because of it's not exported, and the results get used in a different way. Still is a bug in my book.

Jankmarking: Janky Benchmarking

https://www.williamangel.net/blog/2026/05/08/jankmarking.html
1•datadrivenangel•2m ago•0 comments

Self-Updating Screenshots

https://www.jmduke.com/posts/self-updating-screenshots.html
1•speckx•4m ago•0 comments

Robe-ot: the Android monk working to reboot the faith of South Korea's Buddhists

https://www.theguardian.com/world/2026/may/08/jogyesa-temple-south-korea-humanoid-ai-robot-gabi
1•mitchbob•6m ago•0 comments

Global perceptions of US fall below Russia, survey finds

https://www.reuters.com/world/china/global-perceptions-us-fall-below-russia-under-trump-survey-fi...
1•akyuu•6m ago•0 comments

Suspected oil spill seen on satellite images near Iran's Kharg Island

https://www.reuters.com/world/middle-east/suspected-oil-spill-seen-satellite-images-near-irans-kh...
1•geox•8m ago•0 comments

Mosaic

https://idl.uw.edu/mosaic/what-is-mosaic/
1•tosh•9m ago•0 comments

Apollo, Blackstone Weigh $35B Financing for Broadcom

https://www.bloomberg.com/news/articles/2026-05-08/apollo-blackstone-weigh-35-billion-financing-f...
1•petethomas•10m ago•0 comments

Ask HN: Has AppImage won the Linux package wars?

1•stuxnet79•10m ago•0 comments

Progressive Web Components

https://arielsalminen.com/2026/progressive-web-components/
1•mpweiher•11m ago•0 comments

A New Engineering Metric for the AI-Transformation Age

https://www.webwire.com/ViewPressRel.asp?aId=354394
1•alienll•14m ago•0 comments

Show HN: A lie detector game that reads your pulse through your phone camera

https://kouh.me/tells
2•mrkn1•15m ago•0 comments

Show HN: Agent-isolated remote envs with full Docker Compose support

https://github.com/qosha1/remote-compose
1•quinnosha•15m ago•0 comments

I've Banned Query Strings

https://chrismorgan.info/no-query-strings
3•speckx•15m ago•0 comments

Trump releases previously classified UFO files

https://www.reuters.com/world/trump-releases-previously-classified-ufo-files-2026-05-08/
2•afshinmeh•16m ago•0 comments

We've only gone and done it: Changed what you're used to

https://www.theregister.com/site-news/2026/05/06/weve-only-gone-and-done-it-changed-what-youre-us...
1•dijksterhuis•17m ago•0 comments

Teaching Claude Why

https://www.anthropic.com/research/teaching-claude-why
3•pretext•17m ago•0 comments

I've been using Empirical as my memory layer across AI tools

https://empirical.gauzza.com/blog/codex-session-tone-voice-how-i-used-codex-empirical-to-lock-in-...
1•stevendeluth•19m ago•1 comments

Novel macro signals for AI-related job loss?

2•sfmz•19m ago•0 comments

As drought worsens, Western states brace for wildfires, water shortages

https://stateline.org/2026/05/08/as-drought-worsens-western-states-brace-for-wildfires-water-shor...
2•chmaynard•22m ago•0 comments

AI Is Breaking Two Vulnerability Cultures

https://www.jefftk.com/p/ai-is-breaking-two-vulnerability-cultures
1•speckx•22m ago•0 comments

Show HN: Prism – Self-hosted notification gateway (Signal, Telegram, WebPush)

https://github.com/lone-cloud/prism
1•lone-cloud•26m ago•0 comments

New Generation Tri-Digit Character Encoding Table

https://drive.google.com/drive/folders/1H1fs8MckSBomk0s37KN-2atUoUKSoSXY?usp=sharing
3•jackhua18112001•31m ago•1 comments

Meta Is Dying. It's About Time

https://www.nytimes.com/2026/05/08/opinion/meta-facebook-zuckerberg.html
9•flowerlad•31m ago•2 comments

The "Digital Complexity" of Nations

https://github.blog/news-insights/policy-news-and-insights/how-researchers-are-using-github-innov...
1•mlinksva•32m ago•0 comments

Why age assurance laws matter for developers

https://github.blog/news-insights/policy-news-and-insights/why-age-assurance-laws-matter-for-deve...
1•mlinksva•34m ago•0 comments

Rare Look Inside California's Last Nuclear Power Plant

https://www.kqed.org/science/2000835/the-view-inside-californias-last-nuclear-power-plant
2•pseudolus•35m ago•0 comments

Kerncap: Automated Kernel Extraction and Isolation for AMD GPUs

https://arxiv.org/abs/2605.03208
1•matt_d•35m ago•0 comments

Increasing State of Surveillance from All Sides Around the World

https://community.qbix.com/t/increasing-state-of-surveillance-from-all-sides-around-the-world/804
1•EGreg•39m ago•0 comments

Bleeding Llama: Critical Unauthenticated Memory Leak in Ollama

https://www.cyera.com/research/bleeding-llama-critical-unauthenticated-memory-leak-in-ollama
3•nateb2022•39m ago•0 comments

Floppy Days 162 – Interview with Apple Legend, Steve Wozniak

https://www.youtube.com/watch?v=zvPrIrTRdqM
1•oldnetguy•41m ago•0 comments