You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2013/06/20 13:55:17 UTC
svn commit: r1494943 - in /syncope/site/apidocs: 1.0/index.html
1.1/index.html
Author: ilgrosso
Date: Thu Jun 20 11:55:17 2013
New Revision: 1494943
URL: http://svn.apache.org/r1494943
Log:
Fixing 'Frame injection vulnerability in published Javadoc'
Modified:
syncope/site/apidocs/1.0/index.html
syncope/site/apidocs/1.1/index.html
Modified: syncope/site/apidocs/1.0/index.html
URL: http://svn.apache.org/viewvc/syncope/site/apidocs/1.0/index.html?rev=1494943&r1=1494942&r2=1494943&view=diff
==============================================================================
--- syncope/site/apidocs/1.0/index.html (original)
+++ syncope/site/apidocs/1.0/index.html Thu Jun 20 11:55: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;
Modified: syncope/site/apidocs/1.1/index.html
URL: http://svn.apache.org/viewvc/syncope/site/apidocs/1.1/index.html?rev=1494943&r1=1494942&r2=1494943&view=diff
==============================================================================
--- syncope/site/apidocs/1.1/index.html (original)
+++ syncope/site/apidocs/1.1/index.html Thu Jun 20 11:55: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;