hertz
hertz copied to clipboard
"ClientIP" handling is unsafe
https://github.com/cloudwego/hertz/blob/3ac19d5b1158badab0c7fc8e47b2e4ba667c4453/pkg/app/context.go#L980-L994
This code has a security risk, when using the ClientIP function it is easy to be spoofed by "X-Real-IP" and "X-Forwarded-For" to bypass the checks。
This problem also occurs with the Gin framework -> https://github.com/gin-gonic/gin/issues/2473 The fix can be found in their issue。
Thanks for reporting! Are you interested in submitting a pr to fix it? It's OK if it is not so, I'll put it into TODOs.
i want to try it, please assign me.