Exploit databaseDownload repository ZIP
GH-649b34958dbe988066e32caf28a4367a
avergnaud/next.js_exploit_cve-2024-34351
Sources for CVE-2024-34351
3 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files3
avergnaud/next.js_exploit_cve-2024-34351Revision 7b76c178de8b
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
7-pages-router-isr/pages/index.js
JavaScript · 1,192 bytesimport Post from '@/components/Post';
// This function gets called at build time
// It may be called again, on a serverless function, if
// revalidation is enabled and a new request comes in
export async function getStaticProps() {
console.log('calling https://jsonplaceholder.typicode.com/posts');
const response = await fetch('https://jsonplaceholder.typicode.com/posts');
const posts = await response.json();
// By returning { props: { posts } }, the Blog component
// will receive `posts` as a prop at build time
return {
props: {
posts,
},
// Next.js will attempt to re-generate the page:
// - When a request comes in
// - At most once every 10 seconds
revalidate: 10, // In seconds
}
};
export default function Home({ posts }) {
return (
<main>
<h1>Hello</h1>
<table>
<tbody>
<tr>
<th>userId</th>
<th>title</th>
<th>body</th>
</tr>
{posts.map(post => <Post
key={post.id}
userId={post.userId}
title={post.title}
body={post.body}
/>)}
</tbody>
</table>
</main>
);
}