Skip to content

fix: add audited PaymentEscrow reference contract and security docs (closes #86, #85)#121

Open
demarco2016 wants to merge 3 commits into
circlefin:mainfrom
demarco2016:fix/security-paymentescrow-svg-xss
Open

fix: add audited PaymentEscrow reference contract and security docs (closes #86, #85)#121
demarco2016 wants to merge 3 commits into
circlefin:mainfrom
demarco2016:fix/security-paymentescrow-svg-xss

Conversation

@demarco2016

Copy link
Copy Markdown

Summary

This PR addresses two security issues reported in #86 and #85:

#86 — PaymentEscrow Vulnerabilities (4 fixes)

Adds a fully audited reference PaymentEscrow contract plus a security guide.

Vuln Severity Fix
V1 — Overflow on fundedAt + releaseDelay HIGH Cap releaseDelay at 90 days
V2 — No payee recourse HIGH Payee as unconditional release authority
V3 — Fee rate at release time MEDIUM Snapshot feeBpsAtFund in struct
V4 — Single-step ownership LOW Use Ownable2Step

#85 — SVG tokenURI Stored XSS

Adds docs warning against dangerouslySetInnerHTML for on-chain SVG rendering, with safe alternatives.

Files

  • contracts/src/common/PaymentEscrow.sol
  • docs/building-payment-contracts.md
  • docs/svg-tokenuri-security.md

Closes #86
Closes #85

demarco2016 and others added 3 commits May 27, 2026 08:15
Closes: circlefin#86 (PaymentEscrow 4 vulnerabilities)
Closes: circlefin#85 (SVG tokenURI stored XSS)

- Add PaymentEscrow.sol with fixes for all 4 vulns:
  - V1: cap releaseDelay to 90 days (overflow guard)
  - V2: payee as unconditional release authority
  - V3: snapshot feeBpsAtFund at escrow funding time
  - V4: Ownable2Step to prevent ownership lockout
- Add docs/building-payment-contracts.md security guide
- Add docs/svg-tokenuri-security.md with safe rendering snippets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant