Hacker News new | ask | show | jobs
by gsk22 1346 days ago
Can someone explain how such a simple and easily-testable bug existed in a seemingly-important system like this?

I don't know much about Swiss e-voting, but seems even the most brain-dead unit test of the IsProbablePrime function should have caught this.

4 comments

It is brain dead but this is old code from what I recall. We do not have e-voting at this time although the Post which outsourced this first nightmare of a version is still trying to push for it.

I highly doubt we will see e-voting here until there is a verifiable proof that it is verifiable. There was a lot of bad press about this and people don't trust this crap.

They tried a similar thing for E-ID which was supposed to be built by some private cooperation and run on some centralized servers. The people voted against it and now the government has done the right thing and is building an E-ID system that is decentralized and government run. It still has some quirks but it's going in the right direction.

The sad thing is for the governments first version (outsource to private industry) their claim at the poles was that it would take many years for an E-ID if we don't do it this way. Now only 1 year later we have a very good proposal. There is too much corporate interest pushing around pawns in Government at this time even in a direct democracy like Switzerland.

Well, unfortunately they do plan to relaunch their e-voting system next year, after having "tested their system against more than 60'000 attacks from hackers" (whatever that is supposed to mean)...

https://www.srf.ch/news/schweiz/elektronische-stimmabgabe-ha...

https://www.heise.de/news/Schweizer-Post-Hacker-konnten-E-Vo...

Hm, but it sounds quite solid(I only know, what is written in the links):

They made an open public intrusion test with a bug bounty and they released the sources. And so far no one could find a real weakness.

How many nation-states burned their best zero-days on this public intrusion test?
Likely none, but nation-states can also manipulate traditional voting with enough effort.

(classic spycraft, blackmailing of key persons, intercept mailvoting, etc.)

Nothing is 100% secure.

So the question is, is it good enough?

They said they took great effort to verificate the voting and detect manipulation. I cannot confirm or verify it, but since it is open, I could. That is a great step forward, compared to the closed black boxes, e-voting systems I have heard of before.

Your examples are all less scalable and easier to detect that hacking.

> That is a great step forward, compared to the closed black boxes, e-voting systems I have heard of before.

It's still a black box. You have only their word to go that the published source is what is actually running on the machine in front of you in the voting booth. And they have only the word of their computers.

So yes, it's a great step forward, in the same way that going up a flight of stairs is a great step towards reaching orbit.

"their claim at the poles was"

Sorry for being a bit of a pedant but: A pole is a simple structure (eg flag pole), a Pole is a person from Poland and a poll is what you meant 8)

You might be a pedant but it actually helped me understand that message, I was really confused by the poles.
Im not sure if really the simplest test would catch it. You would need to go over n primes and check them, but you might always finish too early.

There is also a question of impact - i think that 19 does not really cause any harm there.

> You would need to go over n primes and check them, but you might always finish too early.

I mean sure, but it's pretty simple to at least enumerate the primes < 100 and test those...

Whats the problem with letting it run for a weeks on 5$ vps

You better have your crypto _primitives_ rock solid

It's not really easily testable, because the bug is in pseudocode which cannot be executed.
I must be missing some context, then. It's unclear to me how pseudocode would be used in e-voting?
I think this is the specification for the software that would be used for e-voting. There is code in that repository too, and it calls a method named isProbablePrime, but I can't see a definition of it.
As humans we do our best, and try to learn from our mistakes.