Exploit database

GH-649b34958dbe988066e32caf28a4367a

avergnaud/next.js_exploit_cve-2024-34351

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-34351

3 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files3

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

7-pages-router-isr/pages/index.js

JavaScript · 1,192 bytes
import 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>
  );
}