Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

  • #004057

  • 5 - Critical

  • Fixed

Issue Confirmations

  • Yes (0)No (0)
Photo

eAAC coin banker missing item check zeny exploit

Posted by Hercules Bot on 13 February 2010 - 07:49 PM

Originally posted by theultramage
http://www.eathena.w...er&showbug=4057

I received a report about an exploit with the custom eAAC coin banker npc, with a video that demonstrated how the issue could be reproduced easily.

Below is the offending code. Notice how the countitem() check is only done at the beginning, followed by a chain of 'next' statements before the actual processing is done (beginner scripter's mistake, I wonder how the reviewers missed this). Also, due to how the actual processing steps are ordered (first get zeny, then delete item), even the recent delitem() script halting system is not able to trap this issue before it's too late.

CODE
    L_Inputing:
        input @coinamount;
        if (@coinamount <= 0) {
            mes @npcname$;
            mes "You didn't input any amount, please retry";
            next;
            goto L_Inputing;
        } else if (countitem(getarg(0)) < @coinamount) {
            mes @npcname$;
            mes "You don't have enough coins, please get some";
            next;
            goto L_Menu;
        } else if (@coinamount*getarg(1) > @MAX_ZENY) {
            mes @npcname$;
            mes "I'm sorry, the quantity you inputted gives a bigger zeny amount than the max allowed. I can't allow this.";
            next;
            goto L_Menu;
        }
        next;
        mes @npcname$;
        mes "So, you want to exchange "+@coinamount+" "+@coinname$+" ?";
        menu "Yes, I want to exchange this much",-,"No, I want to exchange something else",L_CoinZeny,"No, I want to input another number",L_Inputing,"No, I dont want to exchange anything",L_Menu;
        next;
        set @price,getarg(1)*@coinamount;
        set Zeny,Zeny+@price;
        delitem getarg(0),@coinamount;