Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1F3210E42 for ; Wed, 19 Jun 2013 09:27:29 +0000 (UTC) Received: (qmail 50964 invoked by uid 500); 19 Jun 2013 09:27:29 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 50875 invoked by uid 500); 19 Jun 2013 09:27:28 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 50868 invoked by uid 99); 19 Jun 2013 09:27:28 -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 09:27:28 +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 09:27:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 67C4C2388A29 for ; Wed, 19 Jun 2013 09:27:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r866194 - /websites/production/commons/content/sandbox/commons-classscan/apidocs/index.html Date: Wed, 19 Jun 2013 09:27:06 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130619092706.67C4C2388A29@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Wed Jun 19 09:27:06 2013 New Revision: 866194 Log: Apply fix for CVE-2013-1571, a frame injection attack Modified: websites/production/commons/content/sandbox/commons-classscan/apidocs/index.html Modified: websites/production/commons/content/sandbox/commons-classscan/apidocs/index.html ============================================================================== --- websites/production/commons/content/sandbox/commons-classscan/apidocs/index.html (original) +++ websites/production/commons/content/sandbox/commons-classscan/apidocs/index.html Wed Jun 19 09:27:06 2013 @@ -13,6 +13,42 @@ ClassScan 0.2-SNAPSHOT API 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;