v0.5.175: safeReturn fix, stack trace не утекает
This commit is contained in:
+1
-1
@@ -528,7 +528,7 @@ function httpPost(url, body, headers) {
|
||||
* Защита от open redirect: //evil.com и https://evil.com → '/'.
|
||||
*/
|
||||
function safeReturn(target) {
|
||||
if (typeof target === 'string' && target.startsWith('/') && !target.startsWith('//')) {
|
||||
if (typeof target === 'string' && target.startsWith('/') && !target.startsWith('//') && target[1] !== '\\') {
|
||||
return target;
|
||||
}
|
||||
return '/';
|
||||
|
||||
Reference in New Issue
Block a user