-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Type confusion bug in WriteFloatGeneric #12179
Copy link
Copy link
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.securityIssues and PRs related to security.Issues and PRs related to security.
Description
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.securityIssues and PRs related to security.Issues and PRs related to security.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The buffer writeFloatLE family functions are prone to code [remote] execution attacks via type confusion. The binding layer WriteFloatGeneric function just casts the first argument:
node/src/node_buffer.cc
Line 826 in 0e6c336
Few methods are called on the ts_obj after which if you choose a good argument means executing code with some choice.
For example, the following doesn't crash until the memcpy on my machine: