Skip to content

Quality: Silent data corruption from ignored SetString error in NewBuilderBids#789

Open
kumburovicbranko682-boop wants to merge 1 commit into
flashbots:mainfrom
kumburovicbranko682-boop:contribai/improve/quality/silent-data-corruption-from-ignored-sets
Open

Quality: Silent data corruption from ignored SetString error in NewBuilderBids#789
kumburovicbranko682-boop wants to merge 1 commit into
flashbots:mainfrom
kumburovicbranko682-boop:contribai/improve/quality/silent-data-corruption-from-ignored-sets

Conversation

@kumburovicbranko682-boop

Copy link
Copy Markdown

✨ Code Quality

Problem

In NewBuilderBids, big.Int.SetString() returns (value, ok) where ok indicates success, but the return value is completely ignored. If any Redis-stored bid value contains invalid characters for base-10 parsing (e.g., malformed data, corruption, or malicious input), SetString will fail silently - the bid value will remain at its zero-initialized big.Int (0) instead of the actual value. This corrupts auction calculations since zero bids will be considered, potentially causing invalid block selections or fund loss.

Severity: high
File: datastore/utils.go

Solution

In NewBuilderBids, big.Int.SetString() returns (value, ok) where ok indicates success, but the return value is completely ignored. If any Redis-stored bid value contains invalid characters for base-10 parsing (e.g., malformed data, corruption, or malicious input), SetString will fail silently - the bid value will remain at its zero-initialized big.Int (0) instead of the actual value. This corrupts auction calculations since zero bids will be considered, potentially causing invalid block selections or fund loss.

Changes

  • datastore/utils.go (modified)

📝 Summary

⛱ Motivation and Context

📚 References


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

🤖 About this PR

This pull request was generated by ContribAI, an AI agent
that helps improve open source projects. The change was:

  1. Discovered by automated code analysis
  2. Generated by AI with context-aware code generation
  3. Self-reviewed by AI quality checks

If you have questions or feedback about this PR, please comment below.
We appreciate your time reviewing this contribution!

Closes #788

…uilderbids

In `NewBuilderBids`, `big.Int.SetString()` returns `(value, ok)` where ok indicates success, but the return value is completely ignored. If any Redis-stored bid value contains invalid characters for base-10 parsing (e.g., malformed data, corruption, or malicious input), `SetString` will fail silently - the bid value will remain at its zero-initialized `big.Int` (0) instead of the actual value. This corrupts auction calculations since zero bids will be considered, potentially causing invalid block selections or fund loss.


Affected files: utils.go

Signed-off-by: kumburovicbranko682-boop <295886834+kumburovicbranko682-boop@users.noreply.github.com>
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.

fix: silent data corruption from ignored setstring error in newbuilderbids

1 participant