File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ func NewDefender(opts DefenderOptions) *Defender {
157157 `[?&](redirect|return|url|next|dest|destination|continue|view|target|redir|r|u)=https?://` , // Open redirect
158158 `[?&](redirect|return|url|next|dest|destination|continue|view|target|redir|r|u)=//` , // Protocol-relative redirect
159159 `[?&](redirect|return|url|next|dest|destination|continue|view|target|redir|r|u)=.*%2f%2f` , // Encoded // in redirect
160- `(returnUrl|redirect|return|url|next|dest|destination|continue|view|target|redir).*%25[23]` , // Excessive URL-encoded nesting (4+ levels)
160+ `[?&] (returnUrl|redirect|return|url|next|dest|destination|continue|view|target|redir).*%25[23]` , // Excessive URL-encoded nesting (4+ levels)
161161 }
162162
163163 for _ , pattern := range patterns {
Original file line number Diff line number Diff line change @@ -1042,7 +1042,7 @@ func TestDefender_ExcessiveURLEncodedNesting(t *testing.T) {
10421042 name : "Excessive nesting with redirect param" ,
10431043 uri : "/auth?redirect=/page1?redirect%3D/page2?redirect%253D/page3" ,
10441044 suspicious : true ,
1045- reason : "3 + levels of URL encoding detected" ,
1045+ reason : "4 + levels of URL encoding detected" ,
10461046 },
10471047 {
10481048 name : "Simple redirect - no nesting" ,
You can’t perform that action at this time.
0 commit comments