Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade github.com/zeromicro/go-zero/rest/internal/cors
to version 1.5.1 or higher.
Affected versions of this package are vulnerable to Authorization Bypass Through User-Controlled Key due to the improper input validation in the CORS Filter feature. An attacker can bypass CORS policy and make requests to retrieve data on behalf of other users by using a domain that has a suffix matching an allowed domain in the CORS policy.
package main
import (
"errors"
"net/http"
"github.com/zeromicro/go-zero/rest"
)
func main() {
svr := rest.MustNewServer(rest.RestConf{Port: 8888}, rest.WithRouter(mockedRouter{}), rest.WithCors("safe.com"))
svr.Start()
}
type mockedRouter struct{}
// some sensitive path
func (m mockedRouter) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// check user's cookie
// ...
// return sensitive data
w.Write([]byte("social_id: 420101198008292930"))
}
func (m mockedRouter) Handle(_, _ string, handler http.Handler) error {
return errors.New("foo")
}
func (m mockedRouter) SetNotFoundHandler(_ http.Handler) {
}
func (m mockedRouter) SetNotAllowedHandler(_ http.Handler) {
}