Skip to content

[UTXO-BUG] Critical Security Vulnerabilities - Genesis Race & Integer Overflow - #2165

Merged
Scottcjn merged 1 commit into
Scottcjn:mainfrom
zhaog100:utxo-security-audit-20260407
Apr 7, 2026
Merged

Scottcjn merged 1 commit into
Scottcjn:mainfrom
zhaog100:utxo-security-audit-20260407

Conversation

@zhaog100

@zhaog100 zhaog100 commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

漏洞摘要

本PR包含2个关键安全漏洞的失败测试用例:

🔴 漏洞 #1: 创世迁移竞态条件 (100 RTC)

严重程度: Critical
文件: node/utxo_genesis_migration.py
问题: check_existing_genesis() 在事务外调用,可导致资金复制

攻击向量:

  • 两个节点同时运行迁移
  • 都通过检查 → 都创建创世盒子
  • 结果:所有账户余额翻倍

测试文件: node/test_genesis_race.py
修复建议: 将检查移到事务内


🟠 漏洞 #2: 整数溢出DoS (50 RTC)

严重程度: High
文件: node/utxo_db.py
问题: 缺少 fee_nrtc 和 timestamp 范围检查

攻击向量:

  • 提交超大 fee_nrtc (2^63-1)
  • SQLite 整数溢出 → 节点崩溃
  • DoS 攻击

测试文件: node/test_integer_overflow.py
修复建议: 添加整数范围验证


📊 总计

漏洞数量: 2
总赏金: 150 RTC (100 + 50)
测试状态: 失败(需要修复)


🔍 运行测试

cd node
python3 test_genesis_race.py
python3 test_integer_overflow.py

📝 相关 Issue


联系方式

审计者: 小米辣 🌶️
审计日期: 2026-04-07
报告: 见测试文件详细文档

- test_genesis_race.py: Race condition in genesis migration (100 RTC)
  * Demonstrates fund duplication via concurrent migration
  * Vulnerability: check_existing_genesis() outside transaction

- test_integer_overflow.py: Integer overflow DoS (50 RTC)
  * Tests fee_nrtc overflow
  * Tests timestamp overflow
  * Tests negative fee (fund creation)

Total bounty: 150 RTC (100 + 50)
@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Your PR has a BCOS-L1 or BCOS-L2 label
  • New code files include an SPDX license header
  • You've tested your changes against the live node

Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150)

A maintainer will review your PR soon. Thanks for contributing!

@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related size/L PR: 201-500 lines labels Apr 7, 2026
@Scottcjn
Scottcjn merged commit 97c5e9c into Scottcjn:main Apr 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related size/L PR: 201-500 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants