Skip to content

New SSL stream context option to prevent CRIME attack vector - #269

Closed
rdlowrey wants to merge 1 commit into
php:masterfrom
rdlowrey:master
Closed

rdlowrey wants to merge 1 commit into
php:masterfrom
rdlowrey:master

Conversation

@rdlowrey

Copy link
Copy Markdown
Contributor

The CRIME attack vector exploits TLS compression. This patch adds a stream context option allowing servers to disable TLS compression for versions of OpenSSL >= 1.0.0 (which first introduced the SSL_OP_NO_COMPRESSION option). A summary rundown of the CRIME attack can be found here:
https://community.qualys.com/blogs/securitylabs/2012/09/14/crime-information-leakage-attack-against-ssltls

Thanks to @DaveRandom for locating the relevant section of code and for his sage input on the subject.

The CRIME attack vector exploits TLS compression. This patch adds a stream context option
allowing servers to disable TLS compression for versions of OpenSSL >= 1.0.0 (which first
introduced the SSL_OP_NO_COMPRESSION option). A summary rundown of the CRIME attack can
be found at https://community.qualys.com/blogs/securitylabs/2012/09/14/crime-information-leakage-attack-against-ssltls

Thanks to @DaveRandom for pointing out the relevant section of code.
@rdlowrey

Copy link
Copy Markdown
Contributor Author

FWIW, I wasn't sure how to go about adding a .phpt test for this. It directly invokes the relevant openssl function to disable TLS compression. As a result, a test may be out of the purview of php. I suppose one could fire up a socket server, but I suspect that's also not a desirable thing to do in a test case. I have verified that the patch does, in fact, disable TLS compression. According to my research on the CRIME attack this is sufficient to prevent such attacks. What concerns me significantly more is the lack of support for mitigating potential client renegotiation attacks as mentioned recently by @DaveRandom on the internals list. It's trivial to write a socket client to hammer a PHP SSL server into submission without a mechanism for tracking the number of client-initiated renegotiation attempts at the server end.

@php-pulls

Copy link
Copy Markdown

Comment on behalf of lstrojny at php.net:

Merged into 5.4, 5.5 and master. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants