-
Notifications
You must be signed in to change notification settings - Fork 1
π¨ Flash: [CRITICAL] Fix IP extraction vulnerability and build crash #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,24 +69,22 @@ const solanaAdapter = new SolanaAdapter({ | |
| }) | ||
|
|
||
| // Initialize AppKit modal (runs once at module load) | ||
| if (projectId) { | ||
| createAppKit({ | ||
| adapters: [wagmiAdapter, solanaAdapter], | ||
| projectId, | ||
| networks: mainnetNetworks as [AppKitNetwork, ...AppKitNetwork[]], | ||
| defaultNetwork: allNetworks.mainnet, | ||
| metadata: { | ||
| name: 'Flash Protocol', | ||
| description: 'Cross-chain payment gateway', | ||
| url: typeof window !== 'undefined' ? window.location.origin : 'https://flashprotocol.com', | ||
| icons: ['/logo-black.png'], | ||
| }, | ||
| features: { | ||
| analytics: false, | ||
| }, | ||
| themeMode: 'dark', | ||
| }) | ||
| } | ||
| createAppKit({ | ||
| adapters: [wagmiAdapter, solanaAdapter], | ||
| projectId: projectId || 'fallback-project-id', // Ensure AppKit initializes even if NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID is missing during build time | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. β‘ Flash Review π Bug: Using a generic Fix: Ensure the |
||
| networks: mainnetNetworks as [AppKitNetwork, ...AppKitNetwork[]], | ||
| defaultNetwork: allNetworks.mainnet, | ||
| metadata: { | ||
| name: 'Flash Protocol', | ||
| description: 'Cross-chain payment gateway', | ||
| url: typeof window !== 'undefined' ? window.location.origin : 'https://flashprotocol.com', | ||
| icons: ['/logo-black.png'], | ||
| }, | ||
| features: { | ||
| analytics: false, | ||
| }, | ||
| themeMode: 'dark', | ||
| }) | ||
|
|
||
| export function Providers({ children }: { children: ReactNode }) { | ||
| return ( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
β‘ Flash Review
π Bugs: The
clientIpvariable might benullorundefinedif the IP address cannot be determined, which would causesplit()to throw a runtime error before.trim()is called. This could lead to unhandled exceptions in a critical API route.Fix: Add a nullish coalescing operator or a check to safely handle potentially undefined
clientIp: