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

1381.

Show HN: CMS Airship – Simple and Secure CMS(paragonie.com ↗)

1 points · by CiPHPerCoder · 10y ago · discuss

comment 10y ago · link · parent

Thanks for the correction. :)

comment 10y ago · link · parent

One window of vulnerability is the after-party where everyone with a piece of the signing key drinks cocktails together.

comment 10y ago · link · parent

> that the hardware involved in the actual key rollover complies to the highest level specified by FIPS-140 (presumably actually FIPS-140-2).

Eww, FIPS-140-2.

FIPS-140 compliance isn't a selling point. It's more of a genetic marker than anything. Most of the time, it signals to hackers, "we value standards compliance over security."

Did you know that ECB mode is FIPS-140-2 approved, but AEAD modes (i.e. what you should be using to encrypt) such as GCM and OCB are not?

Yes, that ECB mode. https://blog.filippo.io/the-ecb-penguin/

comment 10y ago · link · parent

> Are there any downsides of Convergence?

Your web browser grinds to a halt because almost no one runs a notary. I tried using it for a while.

comment 10y ago · link · parent

> While this is true, what DNSSec solves is the distribution of trusted identity.

Attempts to solve. I don't trust identities just because the US government tells me to do so.

I believe certificate transparency + ubiquitous TLS + RFC 7858 (or DNSCurve/DNSCrypt) is a better cocktail.

1387.

On the (in)security of popular open source PHP CMS platforms(paragonie.com ↗)

1 points · by CiPHPerCoder · 10y ago · discuss

comment 10y ago · link · parent

No, but it's the OpenVPN default, so unencrypted traffic over OpenVPN might be interesting to play with.

comment 10y ago · link · parent

My hope is that, by then, we'd be using 256-bit blocks so we don't need to worry about it.

comment 10y ago · link · parent

Strictly speaking, 112 bits of "security" is "strong" enough. The problem is this is usually measured as the log (base 2) of the number of possible secret keys. It ignores:

  - Block size  <- YOU ARE HERE
  - Cipher mode
  - Cipher construction and integrity checks (for non-AEAD modes)
  - Key exchange
You can break 256 bit AES if you're using 256-bit classical Diffie Hellman, for example. "But AES has 256 bits of security!" is somewhat silly to argue in such a hypothetical protocol.

This is one reason why you're better off ignoring PCI-DSS when it comes to cryptography guidelines (aside from maintaining compliance where you have obligations to remain compliant, of course).

comment 10y ago · link · parent

I got curious and opened this project in JD-GUI. The namespace is afrlew, which I presume is some sort of acronym.

EDIT: Of course it is! AFRLEW = Air Force Research Laboratory Encryption Wizard

The lion's share of the crypto appears to be in called Hut8.class, which JD-GUI didn't fully decode successfully.

This looks odd:

    private void incrementSaltIndex(byte[] paramArrayOfByte, int paramInt)
    {
      int tmp5_4 = (paramInt + 3);
      paramArrayOfByte;
      if (0 == (tmp5_1[tmp5_4] = (byte)(tmp5_1[tmp5_4] + 1)))
      {
        int tmp20_19 = (paramInt + 2);
        paramArrayOfByte;
        if (0 == (tmp20_16[tmp20_19] = (byte)(tmp20_16[tmp20_19] + 1)))
        {
          int tmp35_34 = (paramInt + 1);
          paramArrayOfByte;
          if (0 == (tmp35_31[tmp35_34] = (byte)(tmp35_31[tmp35_34] + 1)))
          {
            int tmp50_49 = (paramInt + 0);
            paramArrayOfByte;
            if (0 == (tmp50_46[tmp50_49] = (byte)(tmp50_46[tmp50_49] + 1))) {
              throw new ArithmeticException("Value overflow");
            }
          }
        }
      }
    }
Their PasswordGenerator class is also interesting. Has a loop that runs for an arbitrary 80000 iterations, etc.

Overall, no obvious vulnerabilities, but definitely in the "written by a bored undergrad student in their spare time" realm from what I saw. Obviously, I wouldn't recommend using it.

1392.

On the (in)security of popular open source PHP CMS platforms(paragonie.com ↗)

5 points · by CiPHPerCoder · 10y ago · discuss

comment 10y ago · link · parent

> To me, the takeaway is that assumptions made for certain algorithms may lose their validity within ten years.

If we hit 2^64 bytes transferred in under one hour as a norm before 2030, I'll be immensely surprised. (This would implicate 128-bit block ciphers for birthday collisions.)

comment 10y ago · link · parent

The OpenSSL blog post was submitted separately as https://news.ycombinator.com/item?id=12351739 in case this story (the branded vulnerability page itself) overtakes it in popularity.

comment 10y ago · link · parent

To put this in context: You should have been avoiding 64-bit block ciphers to begin with.

https://gist.github.com/tqbf/be58d2d39690c3b366ad

Furthermore, as the article says from the getgo, birthday attacks are not new. They are a known problem.

What's new is someone wrote a paper describing a practical attack, and actually bothered to generate enough traffic to exploit the birthday bound of a 64-bit block cipher.

Your takeaway from this should be:

  - If it's not AES or CHACHA20, disable it.
  - If it's not AES_GCM or CHACHA20_POLY1305, consider disabling it.

comment 10y ago · link · parent

Static CSP headers are pretty cool, but they also support nonces, which look like this:

  // In the header:
  'nonce-+2K9dA2eE3a/C16nYmoBr6Dj'
  // In the HTML:
  <script nonce="+2K9dA2eE3a/C16nYmoBr6Dj">/* your code here */</script>
CSP nonces are useful for having dynamically generated Javascript without allowing unsafe-inline.

Check out CSP-Builder if you want a simple interface for adding them to your project: https://github.com/paragonie/csp-builder

  <?php
  use \ParagonIE\CSPBuilder\CSPBuilder;
  
  $csp = CSPBuilder::fromFile('/path/to/source.json');
  ?>
  <!-- snip -->
  <script nonce=<?php echo $csp->nonce('script-src'); ?>>

comment 10y ago · link · parent

Simpler? No. Easier? Yes.

comment 10y ago · link · parent

No, you use

  $pdo->prepare("SELECT id FROM foo WHERE bar = ? AND baz = ?")
      ->execute([$baz, $qux]);
...while taking care to set PDO::ATTR_MODE to PDO::ERRMODE_EXCEPTION and PDO::ATTR_EMULATE_PREPARES to false when your PDO object is initialized.

https://github.com/paragonie/airship/blob/8b7edde11b5b57fcb4...

See also: http://stackoverflow.com/a/12118602/2224584

comment 10y ago · link · parent

> So, to sum up, the author here is right: this is insanity, until PHP provides a module system that can handle PHP abstractions.

I suspect you're being downvoted because we have this: https://getcomposer.org + https://secure.php.net/manual/en/language.oop5.abstract.php

comment 10y ago · link · parent

You're thinking WordPress, which runs 25% of the web.

PHP runs a lot more. Over 80% according to w3techs.

comment 10y ago · link · parent

For anyone not writing C/C++ but still needs a CSPRNG: https://paragonie.com/blog/2016/05/how-generate-secure-rando...

comment 10y ago · link · parent

> That's because those 3 problems I listed up there are easy to solve if you're using /dev/urandom (or the getrandom system call), but extremely tricky otherwise.

Every software developer needs to print out this sentence and stick it above their kanban board (or equivalent).

1403.

Ask HN: Learning better web design practices?

2 points · by CiPHPerCoder · 10y ago · discuss

comment 10y ago · link · parent

> Can or could Airship run in a configuration like that? It doesn't seem to be mentioned in the documentation.

The documentation needs more TLC, and is my current focus. But yes, running the updates from a cron script under a different user than www-data (or equivalent) is not only possible, it's a good idea.

comment 10y ago · link · parent

That's a good idea. I think I'll do that on the next post.

comment 10y ago · link · parent

Nothing, to be truthful.

Nothing stops you from being mean and using a pre-existing botnet to DDoS the update servers, either.

Let's say you manage to pop the WordPress update server and turn every WordPress website on the Internet into a DoS bot. That's 25% of websites, and most likely a large cross-section of all available servers.

There are very few networks that could possibly shoulder that traffic, and I certainly don't have the budget for it right now.

comment 10y ago · link · parent

This is a great opportunity to mention that we have a bug bounty program, as well: https://hackerone.com/paragonie

(Take note of the "average time to resolution".)

comment 10y ago · link · parent

> That's not what "zero day" means.

It's half of the practical concerns with zero days, and the half that most software teams have the least amount of control over.

> It's great that this vendor has mechanism for quickly distributing security updates, but that isn't going to mitigate zero day vulnerabilities.

See: http://www.tripwire.com/state-of-security/incident-detection...

> Rather, zero days would be mitigated by SDLC activities that would help them discover novel vulnerabilities in their code, like design/code reviews, static analysis, or fuzzing.

That's correct, but nontechnical users aren't interested in these details. What's more interesting to them is "When it's fixed, I won't have to do anything to not be vulnerable."

> If they want to reassure their customers that they're good at infosec, then they need to do a lot more than spout some BS about how their automatic update mechanism stops zero days when it can't.

I'll refine the wording a bit better. Thanks for the feedback.

comment 10y ago · link · parent

I added a footnote to clarify the intent.

The point of short statements like that is to encourage further scrutiny from skeptical security folks. Our previous attempts just led to people nodding along and saying "Sounds great!"

https://paragonie.com/blog/2016/05/keyggdrasil-continuum-cry...

comment 10y ago · link · parent

> Many of the other items on the list are unfair to CMS's with a large and thriving plugin ecosystem.

It is explicitly an out-of-the-box comparison.

> Security is a worthy goal, but when it comes to CMS's, a healthy FOSS ecosystem is just as important to support and nurture. You can't try to do everything in the core.

We agree. Airship is free software and has powerful support for plugins. We just try to solve 99% of the security problems in the core so plugin developers can just use the features we provide and don't have to worry about low-level concerns.

1
464748
60