Better HN
topnewbestaskshowjobs
Log inSign up

codedokode

9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions

PHP developer from Russia.
Submissions

comment 1mo ago · link · parent

Many Android phones are not unlockable without hacking. They use cryptography to protect the bootloader and to get the unlock code for your own phone first you need to provide them all your information.

comment 1mo ago · link · parent

You can be impolite at your home as much as you want but in public spaces we need to enforce politeness with harsh punishments.

comment 1mo ago · link · parent

It looks disgusting so I wish there was a hefty punishment and AI cameras.

comment 1mo ago · link · parent

Great let's pay everyone's fare from your income then.

comment 1mo ago · link · parent

No the punishment should be harsher, not for an hour but 40-60 hours, or fine of $1000-2000. Otherwise they will never learn to respect rules. Especially in the subway where you cannot "accidentally" jump over the turnstile.

I regularly see how people are not paying the bus fare (here in Russia). And the only reason why they do not pay is because the punishment is light (fine of ~25 USD) and chance of being caught and actually prosecuted is close to zero. So paying does not make economical sense.

comment 1mo ago · link · parent

Why write? Put your unpatched PHP server to the Internet and someone will show you working exploit.

comment 1mo ago · link · parent

No, PHP interpreter is written in C where such things happen every 100 lines of code. If PHP interpreter was written in Rust, this vulnerability wouldn't exist.

To be fair, C has simplicity as an attractive feature (compared to other languages) but being memory-unsafe is unacceptable, so we need either memory-safe C or stop using it.

comment 1mo ago · link · parent

If the server supports file uploads (like profile avatar), you can upload an image with embedded PHP code in it.

comment 1mo ago · link · parent

To be fair, 2024's "PHP-CGI" and "Windows" are legacy features nobody is probably using. CGI was a technology to write servers using bash scripts (most popular programming language for Linux) and has been outdated for like what, 20 years?

comment 1mo ago · link · parent

No. I think writing PoC and exploits is a waste of time and nobody should do it. PoC brings zero value to society and only helps criminals. If there is use-after-free, it is potentially exploitable and needs to be fixed ASAP. If you don't believe the theory, just keep using the vulnerable version.

comment 1mo ago · link · parent

Just keep your servers with outdated versions and someone will "test" them for you.

comment 1mo ago · link · parent

Lot of non-working PoC and slop are actually good because they waste hackers time to find the working exploit.

comment 1mo ago · link · parent

From my understanding, the vulnerability is a use-after-free, i.e. PHP allocates memory, stores pointer to it, frees it, maybe re-uses the memory for something new and then accesses the pointer. So totally exploitable.

Note that use-after-free would be prevented in memory-safe languages such as Java, Go or Rust.

comment 1mo ago · link · parent

I actually looked through PHP code responsible for parsing POST request body and it's pretty bad [1].

First, there is a huge function, that is hard to read and reason about. Second, instead of proper parsing of "Content-Type" header to extract "boundary" parameter, there is just a set of substring searches which is not correct. It doesn't mean there is a vulnerability but it means PHP can read the header in a way different from a standard-compliant implementation (such as web server, WAF etc).

[1] https://github.com/php/php-src/blob/master/main/rfc1867.c#L7...

comment 1mo ago · link · parent

It is a yet another reminder why we should start new projects with Rust and dig C and C++. Why would anyone want to use C.

comment 1mo ago · link · parent

http-01 seems absolutely unreliable, any hosting provider or any government can issue fake certificates using it. What a garbage technology.

comment 1mo ago · link · parent

Yes Russia shows that even smartest math can be worked around. Everyone who wants to know the real vulnerabilities of electronic voting should study Russian elections.

comment 1mo ago · link · parent

I asked an LLM:

> Me: With this voting technology https://spec.davinci.vote/ how can one verify that the voters are real people and not bots?

> ChatGPT: The key distinction is that DAVINCI can verify that a vote comes from an authorized cryptographic identity, but that does not automatically prove the identity belongs to a real, unique human being.

The algorithm doesn't solve these problems:

- how can I verify that voters ("voter census") are real people and not fake accounts made by govt? I can generate cryptographic identities all day long.

- how can I verify that at the end of elections government doesn't take people who haven't voted, and adds votes in their name using their cryptographic identity?

- if re-votes are allowed (they seem to be) how can I verify that re-votes are made by actual voters and not the government changing their votes in its favor?

- how can I verify that voters are not coerced to vote certain way by their boss at a workplace? For example, in my country, at some workplaces the employer (unofficially) requires a proof of voting, for example, a selfie from a polling place posted to a work chat.

- how can I ensure that the government does not know who voted how? In this case, the one who holds a private key, can decrypt the votes and identify voters who voted the "wrong" way.

The paper you linked to seems to not provide the solutions (I asked ChatGPT to read it for me). It is just a funny math exercise for mathematicians. Also I do not understand why it uses Ethereum and not my own cryptocurrency which obviously would be better because I would get rich quickly.

To compare, in paper voting people leave their signatures in the voters roll, and the marks on the ballots are also unique. While usually nobody checks them, it is still a better trail than a block in Ethereum blockchain that proves nothing. And in paper voting you can see real people putting the ballots into the box while here all you see is zeros and ones.

comment 1mo ago · link · parent

"People watching over each other" usually do not have root (or any) access to the servers, they are usually only shown aggregated stats (like number of votes cast). They usually do not have access to voter details like IP addresses, phone numbers, fingerprints. In some cases, they can read the public "blockchain", but not the private one (in systems with 2 blockchains). The blockchain doesn't contain much useful information to verify, only votes.

The ones who have actual access, are from the government.

comment 1mo ago · link · parent

Yes, coercing the voter in the polling station where there are people monitoring the situation, and police, is more difficult than in supervisor's office in the factory where you just call the employee and order them to vote. No witnesses, no evidence.

comment 1mo ago · link · parent

You cannot verify the tally by examining one ballot.

comment 1mo ago · link · parent

Paper voting at least has a trail. Electronic voting leaves no trail at all.

Re: "voting the graveyard" there are following ways to prevent it:

An election monitor can manually count people coming to the polling station and compare it to the number of ballots taken out of the box. Monitor can observe how those votes are counted, and get a signed document with results. After counting the votes across the country, he can compare his paper document with official published results, filtering them by his polling station. Every step is verifiable.

Also, every voter must leave a signature. Signatures also can be verified.

comment 1mo ago · link · parent

Wrong. With paper voting you can stand in the polling station and see real people getting ballots. With electronic voting you cannot see anything - are real people voting or is it ChatGPT-written script adding records to the database.

Paper voting is 100x more verifiable than electronic.

comment 1mo ago · link · parent

You are over-engineering. You do not need to coerce a voter if you are the administrator and can just add the record into the database directly. Also no need to spend money for a party.

comment 1mo ago · link · parent

"Updating a vote" was supported in 2021 Russian Parliament elections (for Moscow voters). Written in Rust, built on a blockchain with contracts. Source code: [1]. No way blockchain voting can be rigged! It is protected by math!

It immediately raised a suspicion, could the government use "updating a vote" to change the vote of the voter after they voted. There were suspicious bursts of votes for government candidates during early morning (3:00-12:00 AM) between 2nd and 3rd voting days. Could it be re-votings? Who knows, public blockchain has no way to find this out.

How can an observer distinguish between a real voter voting the second time, and the government voting second time in his name?

Furthermore, to cancel the previous vote, you need some way to link the new and old ballots. In the case above, there was a non-public database (a blockchain), unavailable to observers, which kept the needed information. And theoretically it could allow de-anonymize the voters.

So what I wanted to say that electronic voting is a garbage only convenient for fraudsters.

[1] https://github.com/moscow-technologies/blockchain-voting_202...

comment 1mo ago · link · parent

1) How does cryptography helps to verify that the ID cards used by voters belong to real people and not generated for fictious people by the government?

2) How does cryptography helps to verify that teachers vote without pressure and not in principal's office under supervision? Or that they are not forced to give their mobile phones and ID cards to a principal for "inspection"? And the same for employees in large companies, government employees, military, police, doctors etc.

3) How does cryptography helps to verify people are not voting for a payment?

I am surprised that when someone says "cryptography" programmers become so blind that cannot see even the elephant in the room. It feels like everyone is brainwashed by propaganda.

> At any later time you can check with an independent device and look at the transaction finding out that it was altered with and retract your vote / change it.

Easy for a non-programmer.

> these details can be verified at a later date.

After election results are officially confirmed, and cannot be changed.

comment 1mo ago · link · parent

The rule for a decent software should be, not a single packet sent without user authorization. I wonder if such software even exists.

comment 1mo ago · link · parent

Small snails look cute but 8-inch snail sounds a bit scary. Also how do they avoid being eaten by predators if they are slow and vulnerable?

Also I recently saw small slugs which were crawling on the sidewalk along with worms who get to the surface after rain. I wonder what those slugs were planning to do given its middle of October and temperature is merely 10°C (50F)?

comment 1mo ago · link · parent

Looks like government's work to me. Why would someone risk a prison for this.

comment 1mo ago · link · parent

In Russia car mechanics "unlock" Chinese cars that are locked to be operated in China only (such cars are much cheaper than over-priced international versions having the same hardware).
1
456
185