fix: prevent ssrf in perk page

This commit is contained in:
Keeqler
2025-12-10 20:48:48 -03:00
parent 561dae09ca
commit 1d3c86ea05

View File

@@ -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,