Skip to content

Commit f5501a4

Browse files
committed
fix(all): BugFix(等一个CVE)
1 parent 12b2b6d commit f5501a4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.github.fastmirrorserver.controller
2+
3+
import org.springframework.core.annotation.Order
4+
import org.springframework.web.bind.WebDataBinder
5+
import org.springframework.web.bind.annotation.ControllerAdvice
6+
import org.springframework.web.bind.annotation.InitBinder
7+
8+
9+
@ControllerAdvice
10+
@Order(10000)
11+
class GlobalControllerAdvice {
12+
@InitBinder
13+
fun setAllowedFields(dataBinder: WebDataBinder) {
14+
val abd = arrayOf("class.*", "Class.*", "*.class.*", "*.Class.*")
15+
dataBinder.setDisallowedFields(*abd)
16+
}
17+
}

0 commit comments

Comments
 (0)