[Security] Float-to-String Conversion in Financial Parameters (No Decimal Support)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- api, documentation
Research direction
Start with common/src/binance_common/utils.py, especially make_serializable around lines 146-147, and inspect the SDK documentation for financial parameters. Confirm how float values are serialized and document that users should pass financial values as strings; consider whether Decimal support is separately in scope. Done means the guidance clearly addresses the 0.1 + 0.2 precision example and expected usage.
Written by the indexing model from the issue text.
Description
Bug Name
Float-to-String Conversion in Financial Parameters (No Decimal Support)
Attack Scenario
Financial values are converted using Python native float type and str(val) in the make_serializable function. Python float has IEEE 754 double-precision limitations. str(0.1 + 0.2) produces 0.30000000000000004.
Impact
Users who pass Python float values through the SDK may encounter precision issues causing order rejection or unintended quantities.
Components
File: common/src/binance_common/utils.py (lines 146-147, in make_serializable).
Reproduction
- Pass a float value like 0.1 + 0.2 as a price parameter.
- Observe the serialized value is 0.30000000000000004 instead of 0.3.
Fix
Document that users should pass financial values as strings. Consider adding optional Decimal support.
Details
Finding ID: SEC-07
Severity: Informational
Researcher: Independent Security Researcher -- Mefai Security Team
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 699
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from binance/binance-connector-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
binance/binance-connector-python#502 · 2 comments ·
-
USDⓈ-M futures: inter-endpoint skew between /public and /market under load after the base URL split Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
binance/binance-connector-python#553 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
binance/binance-connector-python#513 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 56/100
All issues in binance/binance-connector-python
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100