Exploit databaseDownload repository ZIP
GH-ea9a42220653a920f5cf36a1e45dc902
0xpb1/next.js-cve-2025-29927
Sources for CVE-2025-29927
158 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files3
0xpb1/next.js-cve-2025-29927Revision 459285d633b5
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
pages/login.js
JavaScript · 2,943 bytesimport { useState } from 'react'
import { useRouter } from 'next/router'
import Cookies from 'js-cookie'
export default function Login() {
const [username, setUsername] = useState('')
const [password, setPassword] = useState('')
const [error, setError] = useState('')
const router = useRouter()
const handleSubmit = (e) => {
e.preventDefault()
// Hardcoded admin credentials
if (username === 'admin' && password === 'P@ssw0rd') {
// Set authentication cookie
Cookies.set('auth_token', 'admin_token', { expires: 1 }) // Expires in 1 day
router.push('/admin')
} else {
setError('Invalid credentials')
}
}
return (
<div style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
height: '100vh',
fontFamily: 'Arial, sans-serif',
backgroundColor: '#f5f5f5'
}}>
<div style={{
backgroundColor: 'white',
padding: '2rem',
borderRadius: '8px',
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
width: '100%',
maxWidth: '400px'
}}>
<h1 style={{ marginBottom: '1.5rem', textAlign: 'center' }}>Login</h1>
{error && (
<div style={{
color: 'red',
marginBottom: '1rem',
textAlign: 'center'
}}>
{error}
</div>
)}
<form onSubmit={handleSubmit}>
<div style={{ marginBottom: '1rem' }}>
<label style={{ display: 'block', marginBottom: '0.5rem' }}>
Username:
</label>
<input
type="text"
value={username}
onChange={(e) => setUsername(e.target.value)}
style={{
width: '100%',
padding: '0.5rem',
borderRadius: '4px',
border: '1px solid #ddd'
}}
required
/>
</div>
<div style={{ marginBottom: '1.5rem' }}>
<label style={{ display: 'block', marginBottom: '0.5rem' }}>
Password:
</label>
<input
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
style={{
width: '100%',
padding: '0.5rem',
borderRadius: '4px',
border: '1px solid #ddd'
}}
required
/>
</div>
<button
type="submit"
style={{
width: '100%',
padding: '0.75rem',
backgroundColor: '#0070f3',
color: 'white',
border: 'none',
borderRadius: '4px',
cursor: 'pointer',
fontSize: '1rem'
}}
>
Login
</button>
</form>
</div>
</div>
)
}