Generated WebSocket masks use a secure PRNG by default:

This resolves a medium vulnerability described in the
Beast Hybrid Assessment Report by Bishop Fox, where masks generated
for use with outgoing WebSocket client frames use an insufficient
source of entropy and a non-cryptographically secure pseudo-random
number generator.

By default, all newly constructed WebSocket streams will use a
uniquely seeded secure PRNG (ChaCha20 in counter mode). As this may
result in increased CPU resource consumption, the function
websocket::stream::secure_prng() may be used to select a faster but
less secure PRNG, for the case where the caller knows that the secure
generator is not necessary.

On some systems, std::random_device may produce insufficient entropy
to securely seed the PRNG. As this condition cannot be detected by
Beast, callers may use the function websocket::seed_prng() called
once at startup to provide at least 256 bits of entropy which will
be used to uniquely seed all subsequent PRNGs.
This commit is contained in:
Vinnie Falco committed 2018-07-08 15:20:05 -07:00
1 parent 68727b3cfb
commit 749e54f31b
16 files changed
+495 -139

No files matched your search

+13 -4
View File
@@ -10,8 +10,11 @@
[section Release Notes]
This version fixes a missing executor work guard in all composed operations
used in the implementatio. Users who are experiencing crashes related to
asynchronous completion handlers are encouraged to upgrade.
used in the implementation. Users who are experiencing crashes related to
asynchronous completion handlers are encouraged to upgrade. Also included
is an improved mechanism for generating random numbers used to mask outgoing
websocket frames when operating in the client mode. This resolves a
vulnerability described in the Beast Hybrid Assessment Report from Bishop Fox.
[heading Boost 1.68]
@@ -35,14 +38,20 @@ in future versions.
* New [link beast.ref.boost__beast__http__is_mutable_body_writer `http::is_mutable_body_writer`] metafunction
* New [link beast.ref.boost__beast__websocket__seed_prng `websocket::seed_prng`] for manually providing entropy to the PRNG
* New [link beast.ref.boost__beast__websocket__stream.secure_prng `websocket::stream::secure_prng`] to control whether the connection uses a secure PRNG
[*Improvements]
* Generated WebSocket masks use a secure PRNG by default
* Improvements to [link beast.ref.boost__beast__buffers_adapter `buffers_adapter`]
* ([issue 1109]) Use a shared string for example HTTP server doc roots
* ([issue 1079]) Add [link beast.ref.boost__beast__handler_ptr.has_value `handler_ptr::has_value`]
* Improvements to [link beast.ref.boost__beast__buffers_adapter `buffers_adapter`]
[*Fixes]
* ([issue 1073]) Fix race in advanced server examples
+1
View File
@@ -137,6 +137,7 @@
<simplelist type="vert" columns="1">
<member><link linkend="beast.ref.boost__beast__websocket__async_teardown">async_teardown</link></member>
<member><link linkend="beast.ref.boost__beast__websocket__is_upgrade">is_upgrade</link></member>
<member><link linkend="beast.ref.boost__beast__websocket__seed_prng">seed_prng</link></member>
<member><link linkend="beast.ref.boost__beast__websocket__teardown">teardown</link></member>
</simplelist>
<bridgehead renderas="sect3">Options</bridgehead>