Skip to content

Fix/makecard access control - #77

Merged
Tigo9527 merged 10 commits into
mainfrom
fix/makecard-access-control
Aug 13, 2026
Merged

Tigo9527 merged 10 commits into
mainfrom
fix/makecard-access-control

Conversation

@Tigo9527

@Tigo9527 Tigo9527 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This change is Reviewable

kangjianhu 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 registered cardShop can call it (prevents unauthorized VIP minting and totalCharged inflation).
  • Add a Hardhat upgrade script (+ a wrapper .sh) to upgrade the shared UpgradeableBeacon implementation 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.

@Tigo9527
Tigo9527 merged commit d1b5833 into main Aug 13, 2026
1 check passed
@Tigo9527
Tigo9527 deleted the fix/makecard-access-control branch August 13, 2026 08:27
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.

2 participants