From: Albert Astals Cid Date: Tue, 28 Feb 2017 18:00:48 +0000 (+0100) Subject: Sanitize URLs before passing them to FindProxyForURL X-Git-Tag: archive/raspbian/6.6.0-1+rpi1~1^2^2^2^2^2^2^2^2^2^2^2^2^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2007fd8225c4e089c572ead5a62b699639e9d839;p=kf6-kio.git Sanitize URLs before passing them to FindProxyForURL Remove user/password information For https: remove path and query Thanks to safebreach.com for reporting the problem CCMAIL: yoni.fridburg@safebreach.com CCMAIL: amit.klein@safebreach.com CCMAIL: itzik.kotler@safebreach.com Gbp-Pq: Name Sanitize-URLs-before-passing-them-to-FindProxyForURL.patch --- diff --git a/src/kpac/script.cpp b/src/kpac/script.cpp index b009bc9..916f647 100644 --- a/src/kpac/script.cpp +++ b/src/kpac/script.cpp @@ -754,9 +754,16 @@ QString Script::evaluate(const QUrl &url) } } + QUrl cleanUrl = url; + cleanUrl.setUserInfo(QString()); + if (cleanUrl.scheme() == QLatin1String("https")) { + cleanUrl.setPath(QString()); + cleanUrl.setQuery(QString()); + } + QScriptValueList args; - args << url.url(); - args << url.host(); + args << cleanUrl.url(); + args << cleanUrl.host(); QScriptValue result = func.call(QScriptValue(), args); if (result.isError()) {