Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
0af9c776
Commit
0af9c776
authored
Feb 22, 2012
by
Dave Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 725663 - (CVE-2012-0453) [SECURITY] CSRF vulnerability in the XML-RPC API when using mod_perl
r/a=LpSolit
parent
a50a0814
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
Constants.pm
Bugzilla/WebService/Constants.pm
+8
-0
XMLRPC.pm
Bugzilla/WebService/Server/XMLRPC.pm
+8
-0
user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+5
-0
No files found.
Bugzilla/WebService/Constants.pm
View file @
0af9c776
...
...
@@ -14,6 +14,7 @@ our @EXPORT = qw(
WS_ERROR_CODE
ERROR_UNKNOWN_FATAL
ERROR_UNKNOWN_TRANSIENT
XMLRPC_CONTENT_TYPE_WHITELIST
WS_DISPATCH
)
;
...
...
@@ -162,6 +163,8 @@ use constant WS_ERROR_CODE => {
unknown_method
=>
-
32601
,
json_rpc_post_only
=>
32610
,
json_rpc_invalid_callback
=>
32611
,
xmlrpc_illegal_content_type
=>
32612
,
json_rpc_illegal_content_type
=>
32613
,
};
# These are the fallback defaults for errors not in ERROR_CODE.
...
...
@@ -170,6 +173,11 @@ use constant ERROR_UNKNOWN_TRANSIENT => 32000;
use
constant
ERROR_GENERAL
=>
999
;
use
constant
XMLRPC_CONTENT_TYPE_WHITELIST
=>
qw(
text/xml
application/xml
)
;
sub
WS_DISPATCH
{
# We "require" here instead of "use" above to avoid a dependency loop.
require
Bugzilla::
Hook
;
...
...
Bugzilla/WebService/Server/XMLRPC.pm
View file @
0af9c776
...
...
@@ -73,10 +73,18 @@ use XMLRPC::Lite;
our
@ISA
=
qw(XMLRPC::Deserializer)
;
use
Bugzilla::
Error
;
use
Bugzilla::WebService::
Constants
qw(XMLRPC_CONTENT_TYPE_WHITELIST)
;
use
Scalar::
Util
qw(tainted)
;
sub
deserialize
{
my
$self
=
shift
;
# Only allow certain content types to protect against CSRF attacks
if
(
!
grep
(
$_
eq
$ENV
{
'CONTENT_TYPE'
},
XMLRPC_CONTENT_TYPE_WHITELIST
))
{
ThrowUserError
(
'xmlrpc_illegal_content_type'
,
{
content_type
=>
$ENV
{
'CONTENT_TYPE'
}
});
}
my
(
$xml
)
=
@_
;
my
$som
=
$self
->
SUPER::
deserialize
(
@_
);
if
(
tainted
(
$xml
))
{
...
...
template/en/default/global/user-error.html.tmpl
View file @
0af9c776
...
...
@@ -1699,6 +1699,11 @@
<[% type FILTER html %]> field. (See the XML-RPC specification
for details.)
[% ELSIF error == "xmlrpc_illegal_content_type" %]
When using XML-RPC, you cannot send data as
[%+ content_type FILTER html %]. Allowed content types
are [% constants.XMLRPC_CONTENT_TYPE_WHITELIST.join(', ') %].
[% ELSIF error == "zero_length_file" %]
[% title = "File Is Empty" %]
The file you are trying to attach is empty, does not exist, or you don't
...
...
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