p_consti

joined 2 years ago
[–] p_consti@lemmy.world 4 points 2 weeks ago (1 children)

Basically anything low level. When you need a byte, you also don't use a int, you use a uint8_t (reminder that char is actually not defined to be signed or unsigned, "Plain char may be signed or unsigned; this depends on the compiler, the machine in use, and its operating system"). Any time you need to interact with another system, like hardware or networking, it is incredibly important to know how many bits the other side uses to avoid mismatching.

For purely the size of an int, the most famous example is the Ariane 5 Spaceship Launch, there an integer overflow crashed the space ship. OWASP (the Open Worldwide Application Security Project) lists integer overflows as a security concern, though not ranked very highly, since it only causes problems when combined with buffer accesses (using user input with some arithmetic operation that may overflow into unexpected ranges).

[–] p_consti@lemmy.world 4 points 2 weeks ago (7 children)

Very often you need to choose a type based on the data it needs to hold. If you know you'll need to store numbers of a certain size, use an integer type that can actually hold it, don't make it dependent on a platform definition. Always using int can lead to really insidious bugs where a function may work on one platform and not on another due to overfloe

[–] p_consti@lemmy.world 6 points 3 weeks ago

Got a bit too much into BASIC?

[–] p_consti@lemmy.world 5 points 1 month ago

Adding to this, I had to run both Windows and Linux from a USB-connected m.2 SSD for a while, and noticed similar patterns, checking the disk (or its connection) is probably a good clue.

[–] p_consti@lemmy.world 6 points 2 months ago

The last character

14
submitted 2 months ago* (last edited 2 months ago) by p_consti@lemmy.world to c/summit@lemmy.world
 

See the attached screenshots. The markup seems correct, but somehow the ) is gone in Summit.

Original markup:

Bonus panel![Bonus panel](https://midwest.social/api/v3/image_proxy?url=https%3A%2F%2Fdiscuss.online%2Fpictrs%2Fimage%2Fb2f22051-739c-463f-88b7-6aa3e6406785.png)

Edit: Actually, re-checking my post, I can see even in the code block that the bracket is gone, please use a browser to check the actual source.

[–] p_consti@lemmy.world 7 points 2 months ago (1 children)

Ternary, and inline switch (match expressions), as found in functional languages

[–] p_consti@lemmy.world 10 points 2 months ago

You can configure Grub to boot into whichever entry you last selected. Makes rebooting much more convenient

[–] p_consti@lemmy.world 2 points 2 months ago

Of course it won't do anything, you need to update (refresh the index) before you upgrade (download and install updates), silly you

[–] p_consti@lemmy.world 2 points 3 months ago (1 children)

I would be very interested in that book. My university did not provide explicit book sources, so I can't tell you what that is based on, but here are the relevant slides (from page 9). Server-side hashing is so ubiquitous as the standard that e.g. OWASP cheat sheet doesn't even explicitly say it, but their recommendations hint at it.

A quick google search on the topic revealed others with the same opinion: stackoverflow stackoverflow. The second link (accepted answer in the same thread) argues that with a protocol around it, it can make sense, but never in the situation described here. There needs to be a meaningful computation on the server's side, otherwise the described scenario can happen.

It's a bit difficult to find papers on that because server-side hashing is standard, but here, for example, is a paper that explores client-side hashing (see the introduction with a reference to server-side hashing and section 2): Client Password Hashing paper. Very interesting is also section 3.4. Similar paper: Client-side hashing for efficient typo-tolerant password checkers. Essentially, both suggest that to avoid the described attack, both server-side and client-side hashing is necessary (but the server-side hash can be weaker), see "Authentication attacks after leaks". Neither paper describes how the client-side hashing is done on the Chinese websites they mention.

You'll also find that many frameworks (e.g. ASP.NET, Laravel) implement server-side hashing.

My conclusion from the little research I did after your prompt is that client-side hashing can work, but it's dangerous if done incorrectly (e.g. when done as suggested above), due to the scenario I described.

[–] p_consti@lemmy.world 4 points 3 months ago

Not necessarily. If it's implemented well, the frontend will just show a "success" message, but the email sent will be different. This way, the owner of the account will know if they already have an account, or if it wasn't them, that someone else tried to use their email. Meanwhile the bad actor won't know anything new.

[–] p_consti@lemmy.world 2 points 3 months ago* (last edited 3 months ago) (3 children)

No, it is not. If the server accepts the hash from an untrusted source (the client), then that's equivalent to not using hashes at all. The reason why we hash is so a database leak does not allow malicious actors to login directly. If the server accepts a hash, that means it only does hash_from_client == hash_from_db, meaning that's the same as doing password_from_client == password_from_db in terms of security. This is because the client can just send the hash from the DB, the user does not actually need to know the password, hence your proposal is equivalent to not using hashes at all in terms of security.

The point of sending hashes info from the client is that each site uses a different key, even if publicly available. This means that leaked login data cannot be compared or matched across different leaks.

That is for keyed hash functions, which is not typically done for passwords (but peppers are sometimes used, which helps similarly). This does not prevent the above scenario, though, because the leaked hash can still be used on that site. Sending hashes is a bad idea, the hash should always be computed in a trusted environment to ensure the user actually knows the password.

[–] p_consti@lemmy.world 2 points 3 months ago (5 children)

The client doesn't hash. The client needs to send the plain text. Otherwise, that's a security problem; the server needs to confirm the user knows the actual password, so the server needs to compute the hash and compare. If the client sent the hash, then there was no reason to compute hashes in the first place, because the attacker can just send the leaked hash (the reason to hash it is to avoid that the leak can be used to log in directly).

 

See attached image, the post is clearly referencing a topic, not intended to be a heading. I've similarly seen blog posts that start with "#".

At the very least, headings should be excluded from title markup.

view more: next ›