Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

security hardening bug - stack clash attacks #451

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

victorsosa
Copy link

This is a priority bug: The C++ standard library hardening may detect some invalid out-of-bounds access which have gone unnoticed before.

Compile all binaries with stack clash protection (-fstack-clash-protection). As a result, attempts to jump the stack guard (a requirement for stack clash attacks) will reliably result in a crash rather than giving the attacker control over stack/heap objects.

check link for more details:
https://stackoverflow.com/questions/51661931/rails-s-command-issue/51662528#51662528

so now that the libstdc++ 8.1 is checking with assertions ON. Making this lib compatible with version >8.1 libstdc++

I found the issue and it is related to 'therubyracer' lib
There is a bug with the use of vector out of bounds.

to this line:
return &vector[0];
on file: ext/v8/rr.h#L223

error:
    [vns@betito perseus]$ rails s
    /usr/include/c++/8/bits/stl_vector.h:932: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = v8::Handle<v8::Value>; _Alloc = std::allocator<v8::Handle<v8::Value> >; std::vector<_Tp, _Alloc>::reference = v8::Handle<v8::Value>&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
    Aborted (core dumped)

tested using:


Fedora 28
ruby 2.5.1
rails 5.2.0
libstdc++ 8.1.1

this issue do not happend with libstdc++ < 8.1.1
version 8.1 enable C++ standard library hardening with -D_GLIBCXX_ASSERTIONS. This turns on cheap range checks for C++ arrays, vectors, and strings.

check this link for more details:
https://stackoverflow.com/questions/51661931/rails-s-command-issue/51662528#51662528
@victorsosa
Copy link
Author

NEW Release as soon as possible

@victorsosa victorsosa changed the title security hardening bug security hardening bug - stack clash attacks Nov 1, 2018
@ignisf ignisf requested a review from cowboyd November 1, 2018 19:10
@victorsosa
Copy link
Author

any progress on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant