Fix the Security Issue 49/164049/1
authorcookie <cookie@samsung.com>
Thu, 19 Oct 2017 11:02:19 +0000 (11:02 +0000)
committercookie <cookie@samsung.com>
Fri, 15 Dec 2017 04:35:42 +0000 (13:35 +0900)
There is the file schema issue so it fixed

Change-Id: I4b9c98b5510544e51f641acbcac4b40604f88e3c
Signed-off-by: cookie <cookie@samsung.com>
services/WebPageUI/URIEntry.cpp

index 2e6fc23f3d37a713d88ed516631c86a3d83752f8..a999e742f05668677f8cdaeb900fb32466cba455 100755 (executable)
@@ -276,14 +276,13 @@ std::string URIEntry::rewriteURI(const std::string& url) const
     boost::regex aboutRegex(R"(^about:[^\s]*$)");
     boost::regex fileRegex(R"(^file:///[^\s]*$)");
     boost::regex myfilesappRegex(R"(^file:///opt/usr/media/[^\s]*$)");
-    boost::regex myfilesappetcRegex(R"(^file:///opt/usr/media/../[^\s]*$)");
 
     if (!url.empty()) {
         if (boost::regex_match(url, urlRegex) ||
             boost::regex_match(url, aboutRegex) ||
             boost::regex_match(url, chromeRegex) ||
             (boost::regex_match(url, myfilesappRegex) &&
-             !boost::regex_match(url, myfilesappetcRegex))) {
+            (url.find("../") == std::string::npos))) {
             return url;
         } else if (boost::regex_match(std::string("http://") + url, urlRegex) &&
             (!boost::regex_match(url, fileRegex)) &&