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

61.

How to Write a Secure JWT Library If You Must(scottarc.blog ↗)

3 points · by CiPHPerCoder · 3y ago · discuss

62.

Innovations in the AWS Database Encryption SDK(scottarc.blog ↗)

2 points · by CiPHPerCoder · 3y ago · discuss

63.

Lucid Multi-Key Deputies Require Commitment(scottarc.blog ↗)

2 points · by CiPHPerCoder · 4y ago · discuss

comment 4y ago · link · parent

Not really.

Systems thinking is broader in scope and responsibility. You're going to have to cross the rubicon eventually (unless all the software projects that hire you fail gloriously before they achieve any significant scale, I guess).

Code quality, best practices, etc. involve the same values and priorities as systems thinking, but is scaled down to a bus factor of 1. (i.e. the code you, personally, write or review).

Going beyond n=1 requires building mechanisms and guard-rails to prevent a failure of the individual level from affecting the larger system in a bad way. Thinking about it early won't significantly kneecap you from writing good code.

If it interests you, go for it.

The only reason you might not want to do so is if it doesn't interest you right now. You'll likely get there one day, once a project you care about scales up enough.

65.

We Need Non-Interactive Post-Quantum KEMs(scottarc.blog ↗)

1 points · by CiPHPerCoder · 4y ago · discuss

comment 4y ago · link · parent

How does one measure "better" when it comes to philosophy or spirituality?

The notion that priests and monks should be holier than the common folk strikes me as very Abrahamic. This forms a hierarchy in the mind.

I'm not a Buddhist, but if I were, I would interrogate (and probably reject) such hierarchies.

comment 4y ago · link · parent

You're begging the question. Why should monks and priests be a model, rather than a reminder of human nature?

comment 4y ago · link · parent

Correct.

The strpos() check just prevents the IV from containing ::

comment 4y ago · link · parent

There's this 2009 paper

http://www.cs.rice.edu/~dwallach/pub/crosby-timing2009.pdf

comment 4y ago · link · parent

> Do you think it is better than nothing?

No. This is security theater, and it stands as an obstacle to security. They were better off with plaintext.

> I could set my bar higher, but for living in the real world and that a higher bar would conflict with the high bar of assuming people are of good will and doing the best they can.

Or you could just point PHP developers to my open source libraries, which have a cost of $0.00 to use and are actually secure?

comment 4y ago · link · parent

> To me, it's probably good enough.

Your bar should be a little higher.

> I mean any sophisticated adversary will use the traditional methods of bribery and coercion with violence to obtain intelligence and influence the course of events.

Okay, but we're not talking about someone who failed to meet an ultra paranoid threat model. We're discussing an encryption technique that can be bypassed by anyone who bothered to do the first 2 sets of the cryptopals challenges.

> Yes it doesn't handle an edge case in the same way body armor doesn't handle a 20mm depleted uranium chain gun, but it probably handles the likely threats well enough.

The edge case is "someone with any knowledge about applied cryptography decided to kick the tires, even if only for the laughs". The code is that bad.

comment 4y ago · link · parent

The vulnerability here is that their application-layer cryptography is vulnerable to adaptive chosen-ciphertext attacks, not that a passive observer could sniff packets and see plaintext.

comment 4y ago · link · parent

https://www.php.net/manual/en/errorfunc.configuration.php#in...

I don't know what their PHP configuration is set to in production.

As a rule, I don't test systems that require me to send packets. I only look at code. This keeps me from having to care about the Computer Fraud and Abuse Act.

What I know: The particular bit of code that Paul tweeted is vulnerable, and the mitigation you're asking about only reduces it from a "grep the HTTP response body" oracle to a timing oracle, so it doesn't actually eliminate the issue.

comment 4y ago · link · parent

The blog post is written in conversational English. It is not meant to be a technical, formal paper about their protocol. If you're going to get hung up on that, that's entirely your problem, not mine.

Yes, their fucking thing is vulnerable, because of how PHP + ext/openssl handles padding errors by default. They can mitigate this behavior by suppressing error reporting, but the underlying behavior will still be observable later in the application when `false` is provided instead of a string.

To trigger the vulnerability, you would need the ability to modify a ciphertext. This requires privileged access to where the encrypted data is stored.

Exploit procedure:

  1. Modify ciphertext
  2. Access PHP script that processes said ciphertext under-the-hood
  3. Did it spit out a PHP error?
     * Yes -> Invalid padding
     * No -> Valid padding
Am I going to laboriously describe one of the most well-tested padding oracle exploit paths in the web programming ecosystem in an informal blog post whose purpose is to describe coding/design flaws? No, because that's a waste of everyone's time.

I don't generally write articles with the premise that my audience needs every logical conclusion spoon-fed to them.

> I note that you have not explicitly stated that the system is susceptible to a padding oracle attack either. That's because you have read the same article and can not.

I wrote it, actually.

comment 4y ago · link · parent

> Okay, then we need to tell people where to get this professional training.

I posted a link to a Getting Started guide in my comment above.

Once you've exhausted those resources, your best bet is to join a cryptography team at a tech company to round off your education with some real-world experience.

For example, https://www.amazon.jobs/en/search?business_category[]=amazon...

comment 4y ago · link · parent

> > Using either of the two methods, with the HMAC check completely bypassed, you’ve reduced the security of this construction to unauthenticated AES-CBC mode, which is vulnerable to a Padding Oracle Attack.

> Well was this particular system actually vulnerable to a padding oracle attack?

Yes. That's what the thing you just quoted says.

This isn't a theoretical leap, either. It's unauth CBC with PKCS#7 padding with OpenSSL's API.

> I hate these security writeups that prime the reader but never actually get to the punch line.

But it did. "X uses Y which is vulnerable to Z" does, emphatically, state that X is vulnerable to Z. Your rant is unnecessary.

comment 4y ago · link · parent

It's both.

The strpos() check is what you're describing, but openssl_random_pseudo_bytes() accepts an optional second by-reference argument and sets it to true or false depending on the behavior of RAND_pseudo_bytes().

https://www.php.net/openssl_random_pseudo_bytes

This function also isn't fork-safe in PHP, and has caused RNG collisions before: https://github.com/ramsey/uuid/issues/80

Consequently, I advise against using this function entirely. random_bytes() is better in every way.

comment 4y ago · link · parent

I agree. This was just a write-up I promised the Twitter thread.

https://twitter.com/CiPHPerCoder/status/1538574970011500546

comment 4y ago · link · parent

> We need to stop saying don’t roll your own and start teaching it with good examples and good explanations.

I 100% agree with this statement, in isolation.

But in context, I have to wonder if something in the post sounded like I was telling people not to roll their own? Because that wasn't the take-away.

Either way, https://gotchas.salusa.dev/GettingStarted.html

> So the way you get to become someone who gives this sage advice is by disobeying it.

Lawyers have a similar thing, from what I've been told.

"Don't go to law school", "Don't become a lawyer", etc. are what many lawyer parents have told their children (some of whom went on to become lawyers themselves).

comment 4y ago · link · parent

The main value-add is to replace passwords entirely.

comment 4y ago · link · parent

What about it is sexualized to you, exactly?

I'm not saying your POV is wrong. I'm asking you to explain it.

EDIT: Since you edited your comment, I'll edit mine.

> I wouldn't open this blog at work. I certainly wouldn't buy a children's book with this type of art in it.

Why not? I don't see anything wrong with this blog post. I'd happily share it with colleagues and coworkers alike because it's useful information.

The only crowd that might take offense to the content here are cryptocurrency enthusiasts, because of the shade thrown at secp256k1. But, personally speaking, I'm okay with them being upset with me for sharing a link to such a thing.

> You must have to admit that little red riding hood is usually depicted a lot more modestly.

I'm not sure the same rules of clothing apply to cartoon animal characters as to real-life humans.

I certainly don't shriek if a coworker posts a picture of their pet cat at work without the critter being fully clothed.

What are the standards you're applying to this situation?

Also, the image you linked isn't included in the blog post about elliptic curves, so it's a bit weird to cling to it in defense of your initial reaction.

comment 4y ago · link · parent

I don't see anything sexualized here.

This appears to be a depiction of Red Riding Hood, a fairy tale character that's very frequently introduced to young children in America.

comment 4y ago · link · parent

> This isn't, like, per se a vulnerability; they're not saying it is.

"Defeating" is a really poor choice of verb in the title for a post that isn't claiming a vulnerability.

comment 4y ago · link · parent

BIKE also stands for Bit-flipping Key Encapsulation

https://bikesuite.org

comment 4y ago · link · parent

That was fixed already.

https://wiki.php.net/rfc/named_params

comment 4y ago · link · parent

I will always say VR, I will never say "metaverse".

Their branding move was bold, yet unconvincing.

comment 4y ago · link · parent

I define it as religion for nerds who think they're too smart/clever for religion.

To expand on that, see other critical comments e.g. https://news.ycombinator.com/item?id=30830690

comment 4y ago · link · parent

Enter the prisoner's dilemma

comment 4y ago · link · parent

Yes, it's a firehose. I'm sure you can find a security vendor willing to offer a curated list somewhere.

90.

Line Goes Up – The Problem with NFTs (and “Web 3”)(nfts.io ↗)

3 points · by CiPHPerCoder · 4y ago · 1 comment

12345
60