Skip to content

fix(auth): enforce deterministic amount precision/overflow guarantees in recovery & session flows - #1683

Merged
Baskarayelu merged 2 commits into
Remitwise-Org:mainfrom
Neziahtech:main
Aug 29, 2026
Merged

fix(auth): enforce deterministic amount precision/overflow guarantees in recovery & session flows#1683
Baskarayelu merged 2 commits into
Remitwise-Org:mainfrom
Neziahtech:main

Conversation

@Neziahtech

Copy link
Copy Markdown
Contributor

Closes #1642

Summary

Problem

<What was previously unguarded: e.g. no explicit scale/sign/overflow validation before
state mutation in <file/function>, allowing rounding or truncation to silently alter
stored/displayed amounts, or allowing stale/replayed auth state to reach protected paths.>

Design & Invariants

  • Amount representation: <integer minor-units | fixed-point decimal | library used>
  • Validated at the boundary: <function/endpoint>, before any state mutation
  • Rules enforced: exact scale, non-negative/sign rules, min/max bounds, overflow rejection
  • Rejection is atomic: invalid input never partially applies

Changes

  • <path>:
  • <path>:

Failure Behavior & Compatibility

  • Invalid scale/sign/overflow → rejected with <error type/shape>, no state change
  • Public API/response shape: <unchanged | changed as follows: ...>
  • Migration/rollback: <none required | steps>

Test Evidence

Boundary values tested against independent oracle (<tool/lib>):

  • zero
  • minimum representable value
  • maximum representable value
  • near-overflow (max ± 1 unit)
  • fractional / sub-minor-unit
  • conversion boundary (e.g. currency/unit conversion rounding)

Concurrency/replay:

  • repeated/duplicate request leaves no partial state
  • stale/expired token rejected before mutation
  • concurrent multi-tab/session case

Commands Run

```
<formatter command + result>
<lint command + result>
<type/build command + result>
<full test suite command + result>
<security/contract/migration check command + result, if applicable>
```

Security / Correctness Note

<1 short paragraph: what this guarantees, what it does not cover, any residual
operational limitation or assumption>

Scope Confirmation

  • No unrelated refactors
  • No formatting-only changes bundled in
  • No generated artifacts or secrets included
  • No disabled checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Quality][High] authentication and account recovery: amount precision and overflow — QE-2026-08

2 participants