Fix/makecard access control - #77
Merged
Merged
Conversation
added 10 commits
August 12, 2026 16:59
…nt & totalCharged inflation - contracts/v2/App.sol: makeCard now requires msg.sender == cardShop, the sole legitimate caller. This closes both the unbacked VIP token minting and the arbitrary totalCharged inflation vectors (reported vulnerability). - scripts/upgrade-makecard-fix.ts: self-contained upgrade script that deploys the new App impl and points the shared UpgradeableBeacon at it. Requires only PRIVATE_KEY (beacon owner) plus APP_BEACON or APP_PROXY. Run via 'hardhat --network <net> run scripts/upgrade-makecard-fix.ts'. - SECURITY_REPORT_makeCard_zh.md: Chinese translation + attacker-impact analysis (incl. VIP validity/level) for reference.
…e gas-spending deploy)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an access-control vulnerability in the v2 App.makeCard entry point by restricting it to the intended caller (CardShop), and adds operational tooling/docs to support upgrading existing deployed App instances.
Changes:
- Restrict
App.makeCard(...)so only the registeredcardShopcan call it (prevents unauthorized VIP minting andtotalChargedinflation). - Add a Hardhat upgrade script (+ a wrapper
.sh) to upgrade the sharedUpgradeableBeaconimplementation across all App proxies. - Add a Chinese security report translation with impact/exploitation analysis and remediation guidance.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
contracts/v2/App.sol |
Adds a require(msg.sender == cardShop) gate to makeCard to enforce CardShop-only invocation. |
scripts/upgrade-makecard-fix.ts |
Deploys a fixed App implementation and upgrades the App beacon (optionally deriving beacon from an App proxy via EIP-1967 beacon slot). |
scripts/upgrade-makecard-fix.sh |
Provides a guided, network-aware wrapper for running the upgrade script with environment variables. |
SECURITY_REPORT_makeCard_zh.md |
Documents the vulnerability, PoC, impact analysis, and recommended fixes (Chinese translation + attacker收益分析). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is