[Security] Float-to-String Conversion in Financial Parameters (No Decimal Support)

Open Beginner friendly
#514 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Pass a float value like 0.1 + 0.2 as a price parameter.
  2. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from binance/binance-connector-python

All issues in binance/binance-connector-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.