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
ad1e3aef
Commit
ad1e3aef
authored
Jan 24, 2011
by
David Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 621105 - [SECURITY] Voting lacks CSRF protection
r=mkanat,a=LpSolit
parent
9244270a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
Extension.pm
extensions/Voting/Extension.pm
+4
-0
user.html.tmpl
...ns/Voting/template/en/default/pages/voting/user.html.tmpl
+1
-0
delete-all.html.tmpl
...ns/Voting/template/en/default/voting/delete-all.html.tmpl
+1
-0
No files found.
extensions/Voting/Extension.pm
View file @
ad1e3aef
...
@@ -36,6 +36,7 @@ use Bugzilla::Field;
...
@@ -36,6 +36,7 @@ use Bugzilla::Field;
use
Bugzilla::
Mailer
;
use
Bugzilla::
Mailer
;
use
Bugzilla::
User
;
use
Bugzilla::
User
;
use
Bugzilla::
Util
qw(detaint_natural)
;
use
Bugzilla::
Util
qw(detaint_natural)
;
use
Bugzilla::
Token
;
use
List::
Util
qw(min)
;
use
List::
Util
qw(min)
;
...
@@ -529,6 +530,9 @@ sub _update_votes {
...
@@ -529,6 +530,9 @@ sub _update_votes {
||
ThrowUserError
(
"voting_must_be_nonnegative"
);
||
ThrowUserError
(
"voting_must_be_nonnegative"
);
}
}
my
$token
=
$cgi
->
param
(
'token'
);
check_hash_token
(
$token
,
[
'vote'
]);
############################################################################
############################################################################
# End Data/Security Validation
# End Data/Security Validation
############################################################################
############################################################################
...
...
extensions/Voting/template/en/default/pages/voting/user.html.tmpl
View file @
ad1e3aef
...
@@ -74,6 +74,7 @@
...
@@ -74,6 +74,7 @@
[% IF products.size %]
[% IF products.size %]
<form name="voting_form" method="post" action="page.cgi?id=voting/user.html">
<form name="voting_form" method="post" action="page.cgi?id=voting/user.html">
<input type="hidden" name="action" value="vote">
<input type="hidden" name="action" value="vote">
<input type="hidden" name="token" value="[% issue_hash_token(['vote']) FILTER html %]">
<table cellspacing="4">
<table cellspacing="4">
<tr>
<tr>
<td></td>
<td></td>
...
...
extensions/Voting/template/en/default/voting/delete-all.html.tmpl
View file @
ad1e3aef
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
<form action="page.cgi?id=voting/user.html" method="post">
<form action="page.cgi?id=voting/user.html" method="post">
<input type="hidden" name="action" value="vote">
<input type="hidden" name="action" value="vote">
<input type="hidden" name="token" value="[% issue_hash_token(['vote']) FILTER html %]">
<p>
<p>
<input type="radio" name="delete_all_votes" value="1">
<input type="radio" name="delete_all_votes" value="1">
Yes, delete all my votes
Yes, delete all my votes
...
...
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