News for hackers. Stuff that matters.
Re:Show HN: URL Canary – Get an alert when someone finds you... by dylanpyle on Monday March 19, 2018 @01:00PM (#16620089)
FYI - I signed up and the email confirmation page showed me someone else's canary URL
Re:Show HN: URL Canary – Get an alert when someone finds you... by jstanley on Monday March 19, 2018 @01:02PM (#16620122)
That's not good! Taking a look.

EDIT: I believe it's because the CSPRNG state ( https://metacpan.org/pod/Bytes::Random::Secure::Tiny ) was created before the process forks, so they shared the initial state and generated the same token. I've reduced it to 1 worker pending an actual fix.

Sorry about that, and thanks for pointing it out.

Re:Show HN: URL Canary – Get an alert when someone finds you... by bmm6o on Monday March 19, 2018 @02:57PM (#16621869)
There was a recent discussion about (not) sharing CSPRNG state with fork-ed processes: https://news.ycombinator.com/item?id=15759855
Re:Show HN: URL Canary – Get an alert when someone finds you... by beefhash on Monday March 19, 2018 @01:42PM (#16620781)
Given this kind of disaster potential, wouldn't it be a rather attractive option to use /dev/urandom?
Re:Show HN: URL Canary – Get an alert when someone finds you... by jstanley on Monday March 19, 2018 @01:43PM (#16620806)
Bytes::Random::Secure::Tiny seeds itself from /dev/urandom, I just need to make sure to initialise it on first use, instead of when my program first starts (which I've now done).

In general I suspect if anything you'd be more likely to mess it up by reading bytes from /dev/urandom manually than by using a library.

Re:Show HN: URL Canary – Get an alert when someone finds you... by stouset on Monday March 19, 2018 @07:52PM (#16624575)
How exactly can one mess up reading bytes from `/dev/urandom`? Serious question.

Open the file. Read from it. If no failures on open or read, you have random bytes. In essence, there is already a library for this: `open` and `read`, which seems to be the same API surface area as this library.

Re:Show HN: URL Canary – Get an alert when someone finds you... by beefhash on Tuesday March 20, 2018 @03:50AM (#16626652)
Here's all the ways this can possibly go wrong:

https://insanecoding.blogspot.com/2014/05/a-good-idea-with-b...

Re:Show HN: URL Canary – Get an alert when someone finds you... by stouset on Tuesday March 20, 2018 @07:47PM (#16633922)
Most of these are ridiculous.

First, the author mentions that a `read` from urandom can be interrupted. I am unaware of any system where this is actually possible. And even if it were, the author's original code (and my description of an implementation) already works! The `read` call will return an error, and that error is handled. His "improved" code is simply an optimization around retrying from this device, but it's not an improvement in safety.

His second argument is that /dev/urandom might not have enough randomness in it. This is, quite simply, not a concern for anyone not writing code for specific embedded devices or for extremely early in the kernel boot process. Anyone who is writing code for these environments is almost certainly already aware of these limitations. And even then, using a library like the one the GP is using doesn't actually help, since it's virtually guaranteed to just be reading bytes from `/dev/urandom` for its seed in the first place.

The rest go into situations that — quite frankly — border on ludicrous. If someone has replaced your `/dev/random` with `/dev/zero`, you have already lost and there is nothing you can or should reasonably do besides nuke the machine from orbit.

Re:Show HN: URL Canary – Get an alert when someone finds you... by rocqua on Monday March 19, 2018 @06:08PM (#16623704)
I though the main issue of reading bytes from /dev/urandom was performance (ignoring the issue of ensuring /dev/urandom has been initialized since boot.)

So instead, we use them to seed CPRNGs, and use them for speed.

Re:Show HN: URL Canary – Get an alert when someone finds you... by pinum on Monday March 19, 2018 @09:30PM (#16625189)
This implies that you should probably invalidate all URLs created before you applied that mitigation, right? Or do you have some way (logs?) of knowing which ones were compromised?
Re:Show HN: URL Canary – Get an alert when someone finds you... by moltar on Monday March 19, 2018 @09:26PM (#16625157)
+1 for using Perl

Care to share your stack?

Re:Show HN: URL Canary – Get an alert when someone finds you... by jstanley on Friday March 23, 2018 @06:50AM (#16656697)
Hey, sorry for the late reply. Not sure if you'll read this...

It's mostly http://mojolicious.org/

SQLite for the database (for now; that'll change if it gets too big), and nginx as a reverse proxy in front of Mojolicious. CentOS 7.

Re:Show HN: URL Canary – Get an alert when someone finds you... by moltar on Sunday March 25, 2018 @06:31PM (#16675028)
Cool thank you for response.
Re:Show HN: URL Canary – Get an alert when someone finds you... by oh_sigh on Monday March 19, 2018 @01:37PM (#16620706)
Well, did you go to the URL so that that user will know they used an insecure service?
Re:Show HN: URL Canary – Get an alert when someone finds you... by brianwawok on Monday March 19, 2018 @04:33PM (#16622837)
They forgot to dogfood their own product