Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A966810CAC for ; Wed, 19 Jun 2013 08:38:41 +0000 (UTC) Received: (qmail 73868 invoked by uid 500); 19 Jun 2013 08:38:41 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 73828 invoked by uid 500); 19 Jun 2013 08:38:40 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 73821 invoked by uid 99); 19 Jun 2013 08:38:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2013 08:38:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2013 08:38:38 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 382122388900 for ; Wed, 19 Jun 2013 08:38:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1494501 - /httpcomponents/site/httpcomponents-client-4.3-beta2/apidocs/index.html Date: Wed, 19 Jun 2013 08:38:18 -0000 To: commits@hc.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130619083818.382122388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Wed Jun 19 08:38:17 2013 New Revision: 1494501 URL: http://svn.apache.org/r1494501 Log: Apply fix for CVE-2013-1571, a frame injection attack Modified: httpcomponents/site/httpcomponents-client-4.3-beta2/apidocs/index.html Modified: httpcomponents/site/httpcomponents-client-4.3-beta2/apidocs/index.html URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-client-4.3-beta2/apidocs/index.html?rev=1494501&r1=1494500&r2=1494501&view=diff ============================================================================== --- httpcomponents/site/httpcomponents-client-4.3-beta2/apidocs/index.html (original) +++ httpcomponents/site/httpcomponents-client-4.3-beta2/apidocs/index.html Wed Jun 19 08:38:17 2013 @@ -11,6 +11,42 @@ targetPage = targetPage.substring(1); if (targetPage.indexOf(":") != -1) targetPage = "undefined"; + if (targetPage != "" && !validURL(targetPage)) + targetPage = "undefined"; + function validURL(url) { + var pos = url.indexOf(".html"); + if (pos == -1 || pos != url.length - 5) + return false; + var allowNumber = false; + var allowSep = false; + var seenDot = false; + for (var i = 0; i < url.length - 5; i++) { + var ch = url.charAt(i); + if ('a' <= ch && ch <= 'z' || + 'A' <= ch && ch <= 'Z' || + ch == '$' || + ch == '_') { + allowNumber = true; + allowSep = true; + } else if ('0' <= ch && ch <= '9' + || ch == '-') { + if (!allowNumber) + return false; + } else if (ch == '/' || ch == '.') { + if (!allowSep) + return false; + allowNumber = false; + allowSep = false; + if (ch == '.') + seenDot = true; + if (ch == '/' && seenDot) + return false; + } else { + return false; + } + } + return true; + } function loadFrames() { if (targetPage != "" && targetPage != "undefined") top.classFrame.location = top.targetPage;