mirror of
https://github.com/MAGICGrants/campaign-site.git
synced 2026-01-08 03:53:59 -05:00
fix: prevent ssrf in perk page
This commit is contained in:
@@ -745,6 +745,12 @@ export async function getServerSideProps({ params, req, res }: GetServerSideProp
|
||||
return { redirect: { destination: `/${params?.fund!}` } }
|
||||
}
|
||||
|
||||
const idRegex = /^[0-9a-z]{24}$/
|
||||
|
||||
if (!idRegex.test(`${params?.id!}`)) {
|
||||
return { redirect: { destination: `/${params?.fund!}/perks` } }
|
||||
}
|
||||
|
||||
try {
|
||||
const [
|
||||
balance,
|
||||
|
||||
Reference in New Issue
Block a user