Skip to content

Commit

Permalink
fix controller
Browse files Browse the repository at this point in the history
  • Loading branch information
v1ll4n committed Jul 19, 2024
1 parent fa7df65 commit 5f15e6f
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

import com.alibaba.fastjson.JSON;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/fastjson")
public class FastJSONDemoController {
@GetMapping("/fromId")
public String loadFromParam(@RequestParam(name = "id") String id) {
public ResponseEntity<Object> loadFromParam(@RequestParam(name = "id") String id) {
// This is a FASTJSON Vuln typically.
Object anyJSON = JSON.parse(id);
return JSON.toJSONString(anyJSON);
return ResponseEntity.ok(anyJSON);
}
}

Expand Down

0 comments on commit 5f15e6f

Please sign in to comment.