Created
May 28, 2013 18:19
-
-
Save pgainda/5664890 to your computer and use it in GitHub Desktop.
Now, let's say you're an attacker that really doesn't like Jones. You want to change the amount of money in Jones' bank account from $1,000,000 to $5.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BankAccount( lastname ) { | |
this.lastname = lastname; | |
this.balance = 1000000; | |
} | |
// write your function here | |
function attackBalance(account){ | |
account.balance = 5; | |
} | |
var jonesBankAccount = new BankAccount ("Jones"); | |
console.log("jonesBankAccount has " + jonesBankAccount.balance + " dollars!"); | |
attackBalance(jonesBankAccount); | |
console.log("After attack, jonesBankAccount has " + jonesBankAccount.balance + " dollars!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment