File tree 3 files changed +26
-0
lines changed
javascript/ql/test/query-tests/Security/CWE-918/Request
3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ export async function POST ( req : Request ) {
2
+ const { url } = await req . json ( ) ; // $ MISSING: Source[js/request-forgery]
3
+ const res = await fetch ( url ) ; // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery]
4
+ return new Response ( res . body , { headers : res . headers } ) ;
5
+ }
Original file line number Diff line number Diff line change
1
+ import { NextRequest , NextResponse } from 'next/server' ;
2
+
3
+ export async function POST ( req : NextRequest ) {
4
+ const { url } = await req . json ( ) ; // $ MISSING: Source[js/request-forgery]
5
+ const res = await fetch ( url ) ; // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery]
6
+ const data = await res . text ( ) ;
7
+ return new NextResponse ( data , { headers : res . headers } ) ;
8
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " next-edge-proxy-app" ,
3
+ "version" : " 0.1.0" ,
4
+ "private" : true ,
5
+ "scripts" : {
6
+ "dev" : " next dev" ,
7
+ "build" : " next build" ,
8
+ "start" : " next start"
9
+ },
10
+ "dependencies" : {
11
+ "next" : " 15.1.7"
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments