ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chen...@apache.org
Subject svn commit: r1495527 - in /ctakes/site/trunk/content/apidocs: 3.0.0/index.html trunk/index.html
Date Fri, 21 Jun 2013 18:01:01 GMT
Author: chenpei
Date: Fri Jun 21 18:01:01 2013
New Revision: 1495527

URL: http://svn.apache.org/r1495527
Log:
CTAKES-212 - [SECURITY] Frame injection vulnerability in published Javadoc
Patched the current apidocs hosted on site using the javadoc update tool-inline w/o regenerating.

Modified:
    ctakes/site/trunk/content/apidocs/3.0.0/index.html
    ctakes/site/trunk/content/apidocs/trunk/index.html

Modified: ctakes/site/trunk/content/apidocs/3.0.0/index.html
URL: http://svn.apache.org/viewvc/ctakes/site/trunk/content/apidocs/3.0.0/index.html?rev=1495527&r1=1495526&r2=1495527&view=diff
==============================================================================
--- ctakes/site/trunk/content/apidocs/3.0.0/index.html (original)
+++ ctakes/site/trunk/content/apidocs/3.0.0/index.html Fri Jun 21 18:01:01 2013
@@ -12,6 +12,42 @@ Generated Documentation (Untitled)
         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;

Modified: ctakes/site/trunk/content/apidocs/trunk/index.html
URL: http://svn.apache.org/viewvc/ctakes/site/trunk/content/apidocs/trunk/index.html?rev=1495527&r1=1495526&r2=1495527&view=diff
==============================================================================
--- ctakes/site/trunk/content/apidocs/trunk/index.html (original)
+++ ctakes/site/trunk/content/apidocs/trunk/index.html Fri Jun 21 18:01:01 2013
@@ -12,6 +12,42 @@ Generated Documentation (Untitled)
         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;



Mime
View raw message