Skip to content

[Security] AST-10: Float Type Hint for Financial Amount Parameter #27

@mefai-dev

Description

@mefai-dev

AST-10: Float Type Hint for Financial Amount Parameter

Severity: LOW
Affected File(s): aster/rest_api/account.py:302

Description

The modify_isolated_position_margin function accepts amount: float. Using Python float for financial amounts introduces IEEE 754 floating-point precision errors.

Vulnerable Code

def modify_isolated_position_margin(self, symbol: str, amount: float, type: int, **kwargs):

Impact

Potential rounding errors in margin calculations when users perform arithmetic before passing the value.

Recommended Fix

Accept str or Decimal: def modify_isolated_position_margin(self, symbol: str, amount: str, type: int, **kwargs):


Methodology: Triple-verification static analysis -- each finding verified across three independent code review passes.
Researcher: Independent Security Researcher -- Mefai Security Team

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions