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
d9041c3f
Commit
d9041c3f
authored
Mar 30, 2009
by
reed%reedloden.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 476603 - "[SECURITY] Editing attachments doesn't have any CSRF protection"…
Bug 476603 - "[SECURITY] Editing attachments doesn't have any CSRF protection" [p=reed r=LpSolit a=LpSolit]
parent
e0955c16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
attachment.cgi
attachment.cgi
+9
-0
edit.html.tmpl
template/en/default/attachment/edit.html.tmpl
+3
-0
show.xml.tmpl
template/en/default/bug/show.xml.tmpl
+7
-3
No files found.
attachment.cgi
View file @
d9041c3f
...
...
@@ -565,6 +565,9 @@ sub update {
(
$vars
->
{
'operations'
})
=
Bugzilla::Bug::
GetBugActivity
(
$bug
->
id
,
$attachment
->
id
,
$cgi
->
param
(
'delta_ts'
));
# The token contains the old modification_time. We need a new one.
$cgi
->
param
(
'token'
,
issue_hash_token
([
$attachment
->
id
,
$attachment
->
modification_time
]));
# If the modification date changed but there is no entry in
# the activity table, this means someone commented only.
# In this case, there is no reason to midair.
...
...
@@ -579,6 +582,12 @@ sub update {
exit
;
}
}
# We couldn't do this check earlier as we first had to validate attachment ID
# and display the mid-air collision page if modification_time changed.
my
$token
=
$cgi
->
param
(
'token'
);
check_hash_token
(
$token
,
[
$attachment
->
id
,
$attachment
->
modification_time
]);
# If the submitter of the attachment is not in the insidergroup,
# be sure that he cannot overwrite the private bit.
# This check must be done before calling Bugzilla::Flag*::validate(),
...
...
template/en/default/attachment/edit.html.tmpl
View file @
d9041c3f
...
...
@@ -171,6 +171,9 @@
<input type="hidden" name="action" value="update">
<input type="hidden" name="contenttypemethod" value="manual">
<input type="hidden" name="delta_ts" value="[% attachment.modification_time FILTER html %]">
[% IF user.id %]
<input type="hidden" name="token" value="[% issue_hash_token([attachment.id, attachment.modification_time]) FILTER html %]">
[% END %]
<table class="attachment_info" width="100%">
...
...
template/en/default/bug/show.xml.tmpl
View file @
d9041c3f
...
...
@@ -103,9 +103,13 @@
<type>[% a.contenttype FILTER xml %]</type>
<size>[% a.datasize FILTER xml %]</size>
<attacher>[% a.attacher.email FILTER email FILTER xml %]</attacher>
[% IF displayfields.attachmentdata %]
<data encoding="base64">[% a.data FILTER base64 %]</data>
[% END %]
[%# This is here so automated clients can still use attachment.cgi %]
[% IF displayfields.token && user.id %]
<token>[% issue_hash_token([a.id, a.modification_time]) FILTER xml %]</token>
[% END %]
[% IF displayfields.attachmentdata %]
<data encoding="base64">[% a.data FILTER base64 %]</data>
[% END %]
[% FOREACH flag = a.flags %]
<flag name="[% flag.type.name FILTER xml %]"
...
...
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