summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-07-26 16:44:37 (GMT)
committer Slávek Banko <slavek.banko@axis.cz>2018-07-26 16:44:37 (GMT)
commita3b86c26903ade446ac57afc8c3f8a9c1bd66390 (patch)
tree395cb01a0ee58b4747affd47f89dcbecdbfb877c
parentaa83c86cd30e77bad7fdb2b047ce256a24c883b5 (diff)
downloadtdelibs-a3b86c26.zip
tdelibs-a3b86c26.tar.gz
Fix security issue CVE-2017-6410
[taken from RedHat kdelibs patches] Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--tdeio/misc/kpac/script.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/tdeio/misc/kpac/script.cpp b/tdeio/misc/kpac/script.cpp
index 55faef8..fa12013 100644
--- a/tdeio/misc/kpac/script.cpp
+++ b/tdeio/misc/kpac/script.cpp
@@ -446,10 +446,18 @@ namespace KPAC
if (!findObj.isValid() || !findObj.implementsCall())
throw Error( "No such function FindProxyForURL" );
+ KURL cleanUrl = url;
+ cleanUrl.setPass(QString());
+ cleanUrl.setUser(QString());
+ if (cleanUrl.protocol().lower() == "https") {
+ cleanUrl.setPath(QString());
+ cleanUrl.setQuery(QString());
+ }
+
Object thisObj;
List args;
- args.append(String(url.url()));
- args.append(String(url.host()));
+ args.append(String(cleanUrl.url()));
+ args.append(String(cleanUrl.host()));
Value retval = findObj.call( exec, thisObj, args );
if ( exec->hadException() ) {