eggjs / egg-security

Security plugin for egg, force performance too.
MIT License
238 stars 43 forks source link

不安全地址补充 #91

Closed TangTang25 closed 8 months ago

TangTang25 commented 9 months ago

类似https://test.github.com\@baidu.com这样的地址是不安全的,在domainWhiteList里添加了test.github.com之后还是会redirect,实际上跳转到了baidu.com,希望加上对pathname的过滤

fengmk2 commented 9 months ago

可以来提交一个 pr 修复?

fengmk2 commented 9 months ago

https://github.com\\@baidu.com 并不会跳转到 baidu.com ? 你说的这个问题是怎样重现的?

fengmk2 commented 8 months ago

复现了。

fengmk2 commented 8 months ago

http://github.com\@baidu.com 通过 ctx.redirect('http://github.com\\@baidu.com') 之后会响应经过转码之后的 location,从而导致浏览器跳转到了 baidu.com

< location: http://github.com%5C@baidu.com
fengmk2 commented 8 months ago

https://github.com/koajs/koa/pull/1803