Better HN
topnewbestaskshowjobs
Log inSign up

CiPHPerCoder

6,663 karma · joined Feb 25, 2016 (10y ago) · 1,775 submissions

My name is Scott. I do a lot of open source security research, and cryptography.

Previously AWS Cryptography (2019 - 2023).

Unless otherwise stated, my opinions are my own and do not reflect my employer.

https://scottarc.blog/about/

Submissions

comment 8y ago · link · parent

> You can't take an average and apply it to a specific situation.

In the absence of a more focused study, it's the best we have.

Do you have an alternative study to link to?

comment 8y ago · link · parent

That's a negligible risk. https://web.archive.org/web/20180101025446/https://icdv.idah...

comment 8y ago · link · parent

Cowardice, defined here as the lack of personal integrity in the face of occupational hazards, can sometimes be rational and sometimes be emotional.

Some of the men are demonstrating a rational argument (albeit based on flawed statistics), but they're using it to justify running away from the problem rather than addressing it.

comment 8y ago · link · parent

> I'm not defending their gender policies per say but I am increasingly jealous of societies that actually have a culture other than neoliberalism.

https://scatteredquotes.com/everything-word-horse-shit/

comment 8y ago · link · parent

This is cowardice. Rational cowardice, perhaps, but still cowardice nonetheless.

> “Some men have voiced concerns to me that a false accusation is what they fear,” said Zweig, the lawyer. “These men fear what they cannot control.”

This reveals so much about the mentality of the people being interviewed.

The statistics of false rape accusations do not justify this concern. I would expect that an industry that copes with risk as part of their job to understand this.

https://web.archive.org/web/20180101025446/https://icdv.idah...

comment 8y ago · link · parent

Maybe they just want to quell the blockchainia.

comment 8y ago · link · parent

I predict many confused/rushed tech journalists will write articles that mention "Amazon already has a Quantum Computing Product" after this.

comment 8y ago · link · parent

Did they just ship Trillian, or is this an AWS-exclusive design?

The webpage says they use SHA256, but it doesn't go much more into detail than that.

comment 8y ago · link · parent

This is a dupe of several others on the HN front page today. It looks like https://news.ycombinator.com/item?id=18542597 has the most discussion.

comment 8y ago · link · parent

As someone who gets a ton of spam email and occasional thank you emails from my open source work, I have never been annoyed by a thank you email.

comment 8y ago · link · parent

IIRC scrypt is only defined for powers of 2 for N.

comment 8y ago · link · parent

Oh, this did seem familiar!

The AES-CBC thing is tied to the key, right? So the downgrade attack isn't possible.

comment 8y ago · link · parent

I haven't traced through the app's code to verify that is true.

Recommendation: If there is no HMAC tag with a ciphertext, immediately throw an exception. It makes it clearer that a decryption failure occurred (thus avoiding false positives).

comment 8y ago · link · parent

You're thinking signatures, not encryption.

https://paragonie.com/blog/2018/04/protecting-rsa-based-prot...

comment 8y ago · link · parent

Yes, it's using RSA to encrypt a key, as one would hope. https://github.com/bitwarden/jslib/blob/b4fad203b94da53d3369...

Usually when I see RSA-OAEP in a casual stroll through something's code, I stop there and move onto looking for other issues.

Reason: Very few users of RSA encryption bother to use a secure padding mode. If they're doing that much, the chances of doing something very stupid (a.k.a. "RSA-ECB") is low enough to discount for the purposes of message board discussions.

(Obviously, if I'm being paid to review something, I spend a lot more time on it.)

When I wrote my post above, all I cared about was the modes being used. That's why I vaguely said "some data".

A further analysis (i.e. where rsaEncrypt() is invoked) yields: They're only using RSA for encrypting AES keys, which is a sane design.

Hopefully my lazy word choice didn't cause you (or anyone else) any undue alarm.

comment 8y ago · link · parent

> Wondering how they will address the current cryptographic scheme though.

The only cryptographic weakness Cure53 identified was that a malicious API server could exfiltrate encryption keys.

Cure53 deemed it a hard problem to solve. I wrote a proposed strategy for mitigating it: https://github.com/bitwarden/core/issues/392

Regarding Bitwarden's cryptographic security, a cursory read through their code yields the following:

* It's using RSA-OAEP to encrypt AES keys (EDIT: formerly "some data") https://github.com/bitwarden/jslib/blob/b4fad203b94da53d3369...

* It's using AES-256-CBC https://github.com/bitwarden/jslib/blob/b4fad203b94da53d3369... + https://github.com/bitwarden/jslib/blob/b4fad203b94da53d3369... + https://github.com/bitwarden/jslib/blob/2045e7047a66599b2c8a...

It doesn't appear to be authenticating the AES-CBC-encrypted ciphertexts in all cases, which makes me suspect padding oracles are still in-scope.

https://robertheaton.com/2013/07/29/padding-oracle-attack/

RSA-OAEP is the better RSA mode. (You don't want PKCS1v1.5)

In closing: As long as you're not for some reason storing unauthenticated AES-CBC ciphertexts in the server, the encryption is really boring.

(Boring is good for encryption.)

comment 8y ago · link · parent

What if the opposite effect happens? https://www.marketplace.org/2015/03/03/health-care/how-cost-...

comment 8y ago · link · parent

> What is the fair price for a sugar pill that the doctors and compaines are empowered to lie about.

$0.

Health care costs have ruined many, and that's frankly unethical. I don't see a point treating the unethical American health care system as a premise in these ethical debates.

comment 8y ago · link · parent

Sane middleground:

"We did procedure X, but your insurance covered all of it."

comment 8y ago · link · parent

> Is it okay for doctors to lie about placebo treatments if it actually helps?

I mean, their oath is to help people, not to tell the truth, the whole truth, and nothing but the truth.

comment 8y ago · link · parent

> Find 10 people who have adopted Poly1305 and ask them what Poly1305 does better than GCM.

Two things, one of which cannot be credited to Poly1305 directly.

1. Poly1305 is easier to implement without introducing side-channels (modulo integer multiplication on some CPUs; in which case, I defer to Thomas Pornin on how to avoid them).

2. The Chapoly constructions that use Poly1305 do so in a way that leaking the one-time Poly1305 key doesn't buy you much. (This is the one that cannot be attributed to Poly1305 directly.)

Others may have better or different answers. I implemented it in PHP [1], so anyone reading this thread should keep that in mind. :)

[1] https://github.com/paragonie/sodium_compat/blob/f3b2d775a50d...

comment 8y ago · link · parent

> This article is propaganda.

Someone else called it FUD, now you're calling it propaganda. I'm seeing a pattern.

> This is not the first article of it's kind; they just keep popping up over and over on HN with the same poor arguments. I usually post long explanations as to why these points are invalid but I'm tired of arguing with these people.

...they said, commenting on an Internet board where discussions (a.k.a. arguments) often unfold with these people.

Why are these arguments poor? In what sense does "JWT instead of server-side storage" make a better engineering decision?

> The real reason for these articles I think is that some developers had a very traumatic experience with poorly implemented JWT authentication system once in their life and now nothing will convince them otherwise.

Your ad hominem straw man argument notwithstanding, there are two orthogonal arguments that JWT defenders seem to conflate:

  1. Don't misuse JWT in places it wasn't designed for. <- You are here
  2. JWT is an error-prone cryptographic design and should be replaced with a better standard.
You can agree with one without agreeing with the other.

> Maybe JWTs don't make as. much sense for HTTP but for WebSockets they are absolitely crucial.

Would PASETO be a better fit than JWT for your envisioned WebSockets use case?

https://github.com/paragonie/paseto/tree/master/docs

comment 8y ago · link · parent

The alternative to JWTs isn't rolling your own signing scheme. Use PASETO instead. https://paseto.io

But the issue being discussed in this article is about how JWTs are being used, not JWTs themselves.

> don't do security if you don't understand your primitives..

The security industry needs to do more to provide tools that do security for people who don't understand their primitives.

comment 8y ago · link · parent

> That has nothing to do with JWTs.

Progress! You're so close to understanding the article.

It wasn't ever about JWTs in particular. It was a response to a widespread engineering antipattern of "storing all session state in a cookie then maybe encrypting or HMACing it so you don't have to store anything server-side". JWT was just how developers tended to implement this antipattern.

Like, literally, that was the entire point of the entire article that Sven wrote.

The examples of apps that do this have become less common since the article was written, so if you're confused by that, you're just missing context, and that's OK.

As for "anti-JWT" arguments, I've made them separately from the argument of Sven's claims. JWT is an error-prone cryptographic design. I wrote a replacement standard called PASETO that doesn't contain these foot-bullets. I still don't recommend people use PASETOs for sessions!

comment 8y ago · link · parent

> The basis of that entire argument is based on a false understanding of what JWTs are and how HTTP state transfer works.

I don't even see why you believe this to be the case. The article (and the follow-up) are both pretty clear about what the actual issue is.

Did you read them or just react to the headline?

comment 8y ago · link · parent

> If you're using a system that has them built in, lovely, but if you're not, it's a lot of extra work.

They're built in with PHP and most Node.js frameworks I've ever worked with.

I'm not sure about Python, RoR, etc. web frameworks but the engineering overhead for adopting server-side sessions should approximate 0, since they're usually the default.

comment 8y ago · link · parent

Nobody here was arguing about what JWT is, the article is about how they're often abused in an attempt to obviate server-side persistent data storage in pursuit of "scalability".

The title is "Stop using JWT for sessions" not "Stop using JWT".

The arguments against JWT themselves are wholly separate: https://paragonie.com/blog/2017/03/jwt-json-web-tokens-is-ba...

comment 8y ago · link · parent

It sounds to me like you don't understand what Sven is arguing against in the article.

> JWTs are a encoding format. You can just put a single random unique identifier in there if you want. And you can use "cookies" to transfer JWTs automatically instead of using the Authorization header. Either can be checked on every request by the server.

This is totally irrelevant!

Does your cookie (JWT, PASETO, or whatever) contain more than just a unique identifier?

The argument is: Are you storing things like user_id=13455&is_admin=false in the cookie instead of having that entirely server-side? Don't do that, it's a bad design, store that server-side instead.

That's literally the argument.

comment 8y ago · link · parent

The whole point of the "JWT for Sessions" design was to prevent server-side storage.

Otherwise, they could just use a long random string and maybe HMAC it and call it a day.

1
181920
60