Skip to content

Commit

Permalink
Fix issue #64 (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
evarga committed Jan 4, 2024
1 parent 388c4f6 commit f8ccb2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions Season-2/Level-5/hint-1.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
We can provide a malicious object as the parameter for CryptoAPI.sha1.hash().
What does this trigger?

Example 1:
Example:
$ var s = { toString: function() { alert('Exploit 1'); } };
$ CryptoAPI.sha1.hash(s)

Example 2:
$ var s = { toString: function() { alert('Exploit 1'); } };
$ CryptoAPI.sha1.hash("abc")

Do you want to visualize the above? Follow these instructions:

1. Double click index.html to open it in any browser. Are you using GitHub Codespaces?
Expand Down
3 changes: 2 additions & 1 deletion Season-2/Level-5/solution.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ var CryptoAPI = (function() {
w[(i >> 2) & 15] = j;
j = 0;
}
if ((i & 63) == 63) CryptoAPI.sha1._round(H, w);
// FIX for hack-2.js
if ((i & 63) == 63) internalRound(H, w);
}

for (i = 0; i < H.length; i++)
Expand Down

0 comments on commit f8ccb2b

Please sign in to comment.