Skip to content

hermes-agent [ Crypto ] Fix tx.origin phishing vulnerability in GovernanceToken delegation#5444

Closed
KK88100 wants to merge 1 commit into
UnsafeLabs:mainfrom
KK88100:fix/governancetoken-txorigin-msg.sender-912-1779933843
Closed

hermes-agent [ Crypto ] Fix tx.origin phishing vulnerability in GovernanceToken delegation#5444
KK88100 wants to merge 1 commit into
UnsafeLabs:mainfrom
KK88100:fix/governancetoken-txorigin-msg.sender-912-1779933843

Conversation

@KK88100
Copy link
Copy Markdown

@KK88100 KK88100 commented May 28, 2026

Summary

Replaces all tx.origin usage with msg.sender in GovernanceToken to prevent phishing attacks where malicious contracts could delegate votes on behalf of users.

Changes

  • delegateVote: replaced tx.origin with msg.sender
  • revokeDelegate: replaced tx.origin with msg.sender
  • snapshot: replaced tx.origin == admin with onlyOwner modifier
  • Added onlyOwner modifier using msg.sender == admin
  • Added require(msg.sender != address(0)) guards

Acceptance Checklist

  • No usage of tx.origin remains in the contract
  • All authorization checks use msg.sender
  • onlyOwner modifier protects admin functions
  • Delegated voting still works correctly through legitimate contract interactions

Closes #912

Payment

USDT TRC20: TXjaadYhD579e3bCWKnRFKjRq9RZQL7WNj

…oken

- Replace all tx.origin checks with msg.sender to prevent phishing
- Add msg.sender != address(0) guard
- Add onlyOwner modifier for snapshot function
- Protect delegateVote and revokeDelegate from phishing attacks

Closes UnsafeLabs#912
@github-actions
Copy link
Copy Markdown
Contributor

Unfortunately the changes in this PR didn't fully resolve the issue. Please rework your solution and submit a new pull request.

Make sure to review the acceptance criteria in the linked issue and verify all conditions are met before resubmitting. See CONTRIBUTING.md for guidelines.

@github-actions github-actions Bot closed this May 28, 2026
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.

[ Crypto ] Fix tx.origin phishing vulnerability in GovernanceToken delegation

1 participant