Skip to content

Reject negative Stellar fees and prevent Binance WalletConnect HTLT/Send message confusion - #4796

Open
nikhil-gupta-tw wants to merge 3 commits into
masterfrom
fix/sec-issues-3
Open

Reject negative Stellar fees and prevent Binance WalletConnect HTLT/Send message confusion#4796
nikhil-gupta-tw wants to merge 3 commits into
masterfrom
fix/sec-issues-3

Conversation

@nikhil-gupta-tw

Copy link
Copy Markdown
Contributor

This pull request introduces stricter data validation for several Binance transaction message structs in Rust and adds input validation to the Stellar signing logic in C++. The main goal is to prevent deserialization of unexpected fields and ensure input values are within valid ranges.

Rust: Struct Validation Improvements

  • Added #[serde(deny_unknown_fields)] to the following structs to ensure that only known fields are accepted during deserialization, improving data integrity and error detection:
    • HTLTOrder (htlt_order.rs)
    • DepositHTLTOrder (htlt_order.rs)
    • ClaimHTLTOrder (htlt_order.rs)
    • RefundHTLTOrder (htlt_order.rs)
    • SendOrder (send_order.rs)

C++: Input Validation

  • Added a check in Signer::encode to throw an exception if the fee field is negative, preventing invalid transaction signing requests (Signer.cpp)

@nikhil-gupta-tw
nikhil-gupta-tw requested review from a team and BSCSecChef as code owners June 8, 2026 11:50
@octane-security-app

Copy link
Copy Markdown

Summary by Octane

New Contracts

No new contracts were added.

Updated Contracts

  • htlt_order.rs: Added deny_unknown_fields attribute to enforce strict field validation in all HTLTOrder-related structs.
  • send_order.rs: Added deny_unknown_fields attribute to SendOrder, enforcing strict JSON structure adherence.
  • Signer.cpp: Added a validation to ensure the transaction fee is non-negative before encoding the input.

🔗 Commit Hash: 5f69547

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Binary size comparison

➡️ aarch64-apple-ios:

- 14.31 MB
+ 14.32 MB 	 +6 KB

➡️ aarch64-apple-ios-sim:

- 14.32 MB
+ 14.32 MB 	 +5 KB

➡️ aarch64-linux-android:

- 18.73 MB
+ 18.74 MB 	 +12 KB

➡️ armv7-linux-androideabi:

- 16.17 MB
+ 16.18 MB 	 +11 KB

➡️ wasm32-unknown-emscripten:

- 13.66 MB
+ 13.67 MB 	 +7 KB

@octane-security-app

Copy link
Copy Markdown

Overview

Vulnerabilities found: 1                                                                                
Severity breakdown: 1 High

Detailed findings

rust/chains/tw_binance/src/transaction/message/time_lock_order.rs

  • Partial deny_unknown_fields on untagged BinanceMessageEnum during WalletConnect import causes message-type reinterpretation and potential fund loss. See more

🔗 Commit Hash: 5f69547
🛡️ Octane Dashboard: All vulnerabilities

@Bakomebandias

Copy link
Copy Markdown

Thanks for considering this. I'm an open source developer maintaining 100+ projects on GitHub (bots, EAs, security tools) and I'm ready to help implement or test these features. My wallet for any bounty or grant: 0x2fd73626714d9e37ea464109f8ecea2ca5401062 (Base USDC).

@Bakomebandias

Copy link
Copy Markdown

Thank you for reviewing this feature request.
I am an independent open-source developer maintaining 100+ projects on GitHub (bots, automated trading, security tools, AI assistants).
I have direct experience with mobile money APIs in sub-Saharan Africa and would be happy to contribute code, documentation, or testing if this aligns with the roadmap.
Please let me know if a more detailed technical specification would be helpful.

@Bakomebandias

Copy link
Copy Markdown

For context on my background, some of my related open-source projects can be found at https://github.com/BAKOME-Hub.
Happy to collaborate if this feature moves forward.

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.

3 participants