AI and data stack advisories

Severe, 6 weeks1496Projects326

1496 severe, 6 weeks · 326 projects

AppleGHSA-9556-94c5-c3j8

Executable Stack

Apple

CVE-2019-8849 · Published Nov 25, 2019

Medium
Fix: upgrade to 2.4.1 or later
GitHub advisory

swift-nio-ssl from 2.0.0 to 2.4.0 inclusive on Linux suffered from a bug where the stack of any program using it would accidentally be mapped both writable and executable. This occurred due to the linker on Linux choosing to make the stack executable if the linked output contained any assembly file that did not contain a GNU-stack section with the appropriate content. This was missed when porting the build over from BoringSSL's upstream build, which passes a linker flag to amend this issue.

This cascades into the rest of the linkage process, causing many other binaries to be mapped rwx as well, in addition to the heap. This drastically weakens the security of the process in the face of buffer overflows or other memory mismanagement.

As SwiftPM does not allow us to pass a linker flag, this is fixed by amending the source files to add this section to the assembled output when it is relevant.

All affected users should update to 2.4.1, which contains a fix. If an update is not possible, one appropriate workaround is to build your SwiftPM project with -Xlinker -z -Xlinker noexecstack as extra flags to swift build. This will correctly flag the stack as non-executable.

Affected versions

PackageAffectedFixed in
swift-nio-ssl
Product
< 2.4.12.4.1
Details and references

More Apple advisories

All Apple