Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
8df44a4c
Commit
8df44a4c
authored
Nov 01, 2011
by
Francisco Juan
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit 'v1.5.4'
parents
e7a3230f
b2bbc1cb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
9 deletions
+48
-9
CHANGELOG.rdoc
doc/CHANGELOG.rdoc
+10
-2
Redmine.pm
extra/svn/Redmine.pm
+24
-1
redcloth3.rb
lib/redcloth3.rb
+1
-1
version.rb
lib/redmine/version.rb
+4
-4
textile_formatter_test.rb
...nit/lib/redmine/wiki_formatting/textile_formatter_test.rb
+9
-1
No files found.
doc/CHANGELOG.rdoc
View file @
8df44a4c
= ChiliProject changelog
= ChiliProject changelog
== 2011-10-31 v1.5.4
* Bug #647: XSS: User input for images is not properly sanitized
== 2011-10-04 v1.5.3
* Bug #619: Redmine.pm allows anonymous read access to repositories even if Anonymous role prohibits it
== 2011-08-01 v1.5.2
== 2011-08-01 v1.5.2
* Bug #547: Multiple XSS vulnerabilities
* Bug #547: Multiple XSS vulnerabilities
...
...
extra/svn/Redmine.pm
View file @
8df44a4c
...
@@ -318,7 +318,7 @@ sub access_handler {
...
@@ -318,7 +318,7 @@ sub access_handler {
my
$project_id
=
get_project_identifier
(
$r
);
my
$project_id
=
get_project_identifier
(
$r
);
$r
->
set_handlers
(
PerlAuthenHandler
=>
[
\&
OK
])
$r
->
set_handlers
(
PerlAuthenHandler
=>
[
\&
OK
])
if
is_public_project
(
$project_id
,
$r
);
if
is_public_project
(
$project_id
,
$r
)
&&
anonymous_role_allows_browse_repository
(
$r
)
;
return
OK
return
OK
}
}
...
@@ -390,6 +390,29 @@ sub is_public_project {
...
@@ -390,6 +390,29 @@ sub is_public_project {
$ret
;
$ret
;
}
}
sub
anonymous_role_allows_browse_repository
{
my
$r
=
shift
;
my
$dbh
=
connect_database
(
$r
);
my
$sth
=
$dbh
->
prepare
(
"SELECT permissions FROM roles WHERE builtin = 2;"
);
$sth
->
execute
();
my
$ret
=
0
;
if
(
my
@row
=
$sth
->
fetchrow_array
)
{
if
(
$row
[
0
]
=~
/:browse_repository/
)
{
$ret
=
1
;
}
}
$sth
->
finish
();
undef
$sth
;
$dbh
->
disconnect
();
undef
$dbh
;
$ret
;
}
# perhaps we should use repository right (other read right) to check public access.
# perhaps we should use repository right (other read right) to check public access.
# it could be faster BUT it doesn't work for the moment.
# it could be faster BUT it doesn't work for the moment.
# sub is_public_project_by_file {
# sub is_public_project_by_file {
...
...
lib/redcloth3.rb
View file @
8df44a4c
...
@@ -936,7 +936,7 @@ class RedCloth3 < String
...
@@ -936,7 +936,7 @@ class RedCloth3 < String
stln
,
algn
,
atts
,
url
,
title
,
href
,
href_a1
,
href_a2
=
$~
[
1
..
8
]
stln
,
algn
,
atts
,
url
,
title
,
href
,
href_a1
,
href_a2
=
$~
[
1
..
8
]
htmlesc
title
htmlesc
title
atts
=
pba
(
atts
)
atts
=
pba
(
atts
)
atts
=
" src=
\"
#{
url
}
\"
#{
atts
}
"
atts
=
" src=
\"
#{
htmlesc
url
.
dup
}
\"
#{
atts
}
"
atts
<<
" title=
\"
#{
title
}
\"
"
if
title
atts
<<
" title=
\"
#{
title
}
\"
"
if
title
atts
<<
" alt=
\"
#{
title
}
\"
"
atts
<<
" alt=
\"
#{
title
}
\"
"
# size = @getimagesize($url);
# size = @getimagesize($url);
...
...
lib/redmine/version.rb
View file @
8df44a4c
...
@@ -4,7 +4,7 @@ module Redmine
...
@@ -4,7 +4,7 @@ module Redmine
module
VERSION
#:nodoc:
module
VERSION
#:nodoc:
MAJOR
=
1
MAJOR
=
1
MINOR
=
5
MINOR
=
5
PATCH
=
2
PATCH
=
4
TINY
=
PATCH
# Redmine compat
TINY
=
PATCH
# Redmine compat
def
self
.
revision
def
self
.
revision
...
...
test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
View file @
8df44a4c
...
@@ -86,6 +86,14 @@ class Redmine::WikiFormatting::TextileFormatterTest < HelperTestCase
...
@@ -86,6 +86,14 @@ class Redmine::WikiFormatting::TextileFormatterTest < HelperTestCase
)
)
end
end
def
test_textile_should_escape_image_urls
# this is onclick="alert('XSS');" in encoded form
raw
=
'!/images/comment.png"onclick=alert('XSS');"!'
expected
=
'<img src="/images/comment.png"onclick=&#x61;&#x6c;&#x65;&#x72;&#x74;&#x28;&#x27;&#x58;&#x53;&#x53;&#x27;&#x29;;&#x22;" alt="" />'
assert_html_output
(
raw
=>
expected
)
end
private
private
def
assert_html_output
(
to_test
)
def
assert_html_output
(
to_test
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment