Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: nginx, security hardening of ssl_ecdh_curve #652

Closed
patschi opened this issue Feb 12, 2019 · 2 comments
Closed

Feature Request: nginx, security hardening of ssl_ecdh_curve #652

patschi opened this issue Feb 12, 2019 · 2 comments

Comments

@patschi
Copy link
Contributor

patschi commented Feb 12, 2019

Requested change
For security purposes I'd suggest removing following hardcoded option in nginx configurations:

ssl_ecdh_curve secp384r1;

Reason
There are rumors that NSA was involved when secp curves were defined and has a hidden backdoor-thing, that's why currently X25519 (also due to performance benefit) is getting more and more widely used. By using the auto setting above the X25519 will be preferred automatically on actual OpenSSL releases.

Since nginx v1.11.0 (~May 2016) the new default value of ssl_ecdh_curve is auto which automatically uses the order as provided by OpenSSL. That way the best order of curves will be used as defined in OpenSSL without overwriting any specific settings which might get outdated over time.

Some more ressources to read on:

Change recommendation
To also have backwards compatibilty, I'd suggest following:

  • An option to be able to set ssl_ecdh_curve on Settings - Webserver Settings (for advanced users which are not happy with default configuration)
  • Adding a warning that auto value is >= 1.11.0 to above mentioned option
  • For existing and new installations I'd recommend leaving the option empty to remove the nginx setting completely. This works for all nginx versions. This behaves this way:
    • When <1.11.0: Defaults to prime256v1, similar to first curve recommendation by Mozilla. (When specifyng just one, there's no fallback when specific curve is not supported by client.)
    • When >1.11.0: Defaults to auto, using recommended curves provided by OpenSSL.

When using nginx >= 1.11.0 and current OpenSSL 1.1.1 this results in following server-preferred order: x25519, secp256r1, x448, secp521r1, secp384r1, which are the recommended and most-secure curves as of now. So quite similar to what Cloudflare actually uses for all their hosted sites.

@d00p
Copy link
Member

d00p commented Feb 13, 2019

current debian stable for example is 1.10.3. And if i understand you correctly the auto option was introduced in 1.11.0 - we might need to parse the nginx version (if possible) in php or (maybe better) in the nginx vhost conf itself when set to auto and version <1.11.0 then leave empty else use auto? would that make sense?

@patschi
Copy link
Contributor Author

patschi commented Feb 13, 2019

That was also an idea I thought of, but simply removing the configuration setting might have two advantages:

  • It is easier to manage for existing and new installations. So no need to parse the nginx version.
  • If the config option is simply not provided for <1.11.0, nginx will use secp256r1 which is the first suggested cipher by Mozilla anyway (see "Modern compatibility"). So this might be also an acceptable option IMHO.

@d00p d00p closed this as completed in 8b417c0 Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants