public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "willcoster at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug stdio/27124] New: libio vtable hardening bypass via obstack files
Date: Mon, 28 Dec 2020 23:15:07 +0000	[thread overview]
Message-ID: <bug-27124-131@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=27124

            Bug ID: 27124
           Summary: libio vtable hardening bypass via obstack files
           Product: glibc
           Version: 2.32
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: willcoster at gmail dot com
  Target Milestone: ---

It is possible to bypass existing libio vtable hardening by using the
_IO_obstack_jumps vtable and a forged obstack.

The obstack struct contains unmangled pointers to a custom allocator [1] which
is used when growing an obstack [2, 3, 4].

Both of the methods listed in the _IO_obstack_jumps vtable attempt to grow an
obstack when certain conditions are met [5, 6].

This is similar to Bug 23236 and would allow an attacker with the ability to
corrupt FILE objects to gain code execution. I have tested and confirmed that
this works on glibc 2.32.

I am filing this in the public tracker in accordance with the guidance that
hardening bypasses are not considered security issues in and of themselves [7].

[1]
https://sourceware.org/git/?p=glibc.git;a=blob;f=malloc/obstack.h;h=4b1ba80047b378fa63739e5dbbbf748ca026e197;hb=refs/heads/release/2.32/master#l153
[2]
https://sourceware.org/git/?p=glibc.git;a=blob;f=malloc/obstack.h;h=4b1ba80047b378fa63739e5dbbbf748ca026e197;hb=refs/heads/release/2.32/master#l296
[3]
https://sourceware.org/git/?p=glibc.git;a=blob;f=malloc/obstack.c;h=0d652be9f5d4c0e88e55bf84bbc1053c20d7ce83;hb=refs/heads/release/2.32/master#l261
[4]
https://sourceware.org/git/?p=glibc.git;a=blob;f=malloc/obstack.c;h=0d652be9f5d4c0e88e55bf84bbc1053c20d7ce83;hb=refs/heads/release/2.32/master#l121
[5]
https://sourceware.org/git/?p=glibc.git;a=blob;f=libio/obprintf.c;h=e440cd74c3caf3ee5bbfec9aa1e3ff880f0b3fb7;hb=refs/heads/release/2.32/master#l48
[6]
https://sourceware.org/git/?p=glibc.git;a=blob;f=libio/obprintf.c;h=e440cd74c3caf3ee5bbfec9aa1e3ff880f0b3fb7;hb=refs/heads/release/2.32/master#l76
[7]
https://sourceware.org/glibc/wiki/Security%20Exceptions#Post-exploitation_countermeasures

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2020-12-28 23:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 23:15 willcoster at gmail dot com [this message]
2022-04-26  9:18 ` [Bug stdio/27124] " fweimer at redhat dot com
2022-12-19 18:56 ` cvs-commit at gcc dot gnu.org
2023-07-05  8:30 ` fweimer at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27124-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).