Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Security problems with UnManagedStruct
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Leopold Toetsch  
View profile  
 More options Jan 27 2004, 8:48 pm
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Tue, 27 Jan 2004 16:29:44 +0100
Local: Tues, Jan 27 2004 10:29 am
Subject: Security problems with UnManagedStruct
Please have a look at the following code:

$ cat hack_self.imc
.include "datatypes.pasm"

.sub _main
        new $P1, .PerlArray
        push $P1, .DATATYPE_INTVAL
        push $P1, 32
        push $P1, 0
        push $P1, .DATATYPE_FLOATVAL
        push $P1, 32
        push $P1, 0

         .sym pmc Nul
        null Nul
        getinterp P5
        dlfunc P0, Nul, "Parrot_UnManagedStruct_get_pointer", "pIP"
        invoke
        set $P2, P5
        assign $P2, $P1

        print I20
        print "\n"
        print N10
        print "\n"

        set $P2[0;20], 20
        set $P2[1;10], 42.0

        print I20
        print "\n"
        print N10
        print "\n"
        end
.end
$ parrot hack_self.imc
0
0.000000
20
42.000000

This is unlimited self-inspection and self-modification :) With little
additions (nested structs) one could read/write all Parrot_Interp
internals (including possible security bits) and not only registers like
above. But current state is already sufficient to seriously damage the
interpreter ($P2 above is a struct representing the current interpreter)

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.