Skip to content

fix: resolve assigned security issues#559

Open
oche11207-art wants to merge 2 commits into
MettaChain:mainfrom
oche11207-art:fix/assigned-security-issues
Open

fix: resolve assigned security issues#559
oche11207-art wants to merge 2 commits into
MettaChain:mainfrom
oche11207-art:fix/assigned-security-issues

Conversation

@oche11207-art

Copy link
Copy Markdown
Contributor

Closes #448, #442, #439, #431

Changes

#448 - deviceId stored unencrypted in localStorage

  • Replaced localStorage-based device ID with per-session in-memory ID
  • Added \hashDeviceId()\ for use cases requiring persistence

#442 - Chainalysis API key exposed via window global

  • Removed \window.CHAINALYSIS_API_KEY\ from client-side code
  • Created /api/security/address-check\ proxy API route
  • API key is now read from \CHAINALYSIS_API_KEY\ env var server-side only
  • Added \checkAddressRiskViaProxy()\ for browser-side calls

#439 - chart.tsx uses dangerouslySetInnerHTML for SVG payload

  • Added DOMPurify sanitization for style tag content
  • Extracted CSS building into pure \�uildChartCSS()\ function
  • Sanitizes CSS before injecting into DOM

#431 - batchTransaction confirmation logic races simulation branches

  • Replaced \Math.random()\ simulation with real viem provider reads
  • Demo/simulation path now behind \NEXT_PUBLIC_DEMO_TX\ feature flag
  • Uses \waitForTransactionReceipt\ for production path

Testing

  • All typecheck errors are pre-existing and unrelated to these changes
  • Added \NEXT_PUBLIC_DEMO_TX=false\ to .env.example

Issue MettaChain#453 (P1): PropertyCard - remove nested interactive elements
- Replace outer <Link> with <article> to fix nested-interactive violation
- Add explicit <Link> for property title and View button
- Remove stopPropagation calls (no longer needed without parent link)
- Update a11y tests to match new DOM structure

Issue MettaChain#454 (P3): ViewToggle - add accessible names
- Add aria-labels to grid/list buttons for screen-reader support
- Wrap text in <span> for icon-only rendering scenarios

Issue MettaChain#451 (P2): Share URL security
- Create centralized share URL utility with URL validation
- Sanitize display strings to constrained character set
- Use URL constructor to validate all URLs
- Integrate into ShareButton and MortgageCalculator

Issue MettaChain#452 (P2): Global listener leak prevention
- Add cleanup functions for extension event listeners
- Track console overrides for restoration on cleanup
- Create usePerformanceMonitoring hook with lifecycle management
- MettaChain#448: deviceId stored unencrypted in localStorage - use per-session in-memory ID
- MettaChain#442: Chainalysis API key exposed via window global - proxy API route
- MettaChain#439: chart.tsx dangerouslySetInnerHTML - sanitize with DOMPurify
- MettaChain#431: batchTransaction confirmation races - viem provider reads + DEMO flag

Copy link
Copy Markdown
Contributor

Same head SHA as #560 (literally identical commit 64ff095…). Closing this duplicate.

@nanaf6203-bit nanaf6203-bit 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.

Thanks @oche11207-art — strong set of fixes covering #448, #442, #439, #431. Solid work on deviceId, Chainalysis, ChartStyle, and batch-tx. This branch has merge conflicts against current main though. Please rebase and resolve before we can land it. 🔒

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.

security: deviceId stored unencrypted in localStorage

3 participants