fix: resolve 4 security and performance issues (#427, #430, #433, #440)#606
Open
solomon35-stack wants to merge 2 commits into
Open
Conversation
- MettaChain#427: Add setInterval cleanup guards in propertyCache.ts, rateLimit.ts, and structuredLogger.ts to prevent interval leaks on HMR and module re-imports - MettaChain#430: Remove dangerouslySetInnerHTML from chart.tsx; use safe React style children instead - MettaChain#433: Add normalizeToBigInt helper with parseEther in blockchainSecurity.ts to handle hex, scientific notation, and decimal ether input values - MettaChain#440: Replace document.write in compare/page.tsx with safe DOM API calls (createElement, textContent) for PDF export Closes MettaChain#427, Closes MettaChain#430, Closes MettaChain#433, Closes MettaChain#440
|
@solomon35-stack Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
This PR fixes four issues assigned to @solomon35-stack:
🔒 #430 - Remove dangerouslySetInnerHTML (P0 security)
dangerouslySetInnerHTMLinchart.tsxChartStyle component with safe React\<style\>children🔒 #440 - Remove document.write (P1 security)
document.write()incompare/page.tsxhandleExportPDF with safe DOM API calls (createElement,textContent)doc.close()beforeprint()for proper browser rendering🔒 #433 - BigInt input normalisation (P1 security)
normalizeToBigInthelper inblockchainSecurity.tsto handle:parseEtherfrom viem)BlockchainSecurityErrorclass with typed error codes⚡ #427 - setInterval cleanup (P2 performance)
startCleanupTimer(), exportedstopRateLimitCleanup()destroy()exists for manual cleanupFiles Changed
Validation
Closes #427, Closes #430, Closes #433, Closes #440