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
362e6897
Commit
362e6897
authored
Oct 16, 2013
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 913904: (CVE-2013-1734) [SECURITY] CSRF when updating attachments
r=dkl a=sgreen
parent
637fb098
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
attachment.cgi
attachment.cgi
+10
-7
No files found.
attachment.cgi
View file @
362e6897
...
...
@@ -637,19 +637,22 @@ sub update {
$attachment
->
set_filename
(
scalar
$cgi
->
param
(
'filename'
));
# Now make sure the attachment has not been edited since we loaded the page.
if
(
defined
$cgi
->
param
(
'delta_ts'
)
&&
$cgi
->
param
(
'delta_ts'
)
ne
$attachment
->
modification_time
)
{
(
$vars
->
{
'operations'
})
=
$bug
->
get_activity
(
$attachment
->
id
,
$cgi
->
param
(
'delta_ts'
));
my
$delta_ts
=
$cgi
->
param
(
'delta_ts'
);
my
$modification_time
=
$attachment
->
modification_time
;
# The token contains the old modification_time. We need a new one.
$cgi
->
param
(
'token'
,
issue_hash_token
([
$attachment
->
id
,
$attachment
->
modification_time
]));
if
(
$delta_ts
&&
$delta_ts
ne
$modification_time
)
{
datetime_from
(
$delta_ts
)
or
ThrowCodeError
(
'invalid_timestamp'
,
{
timestamp
=>
$delta_ts
});
(
$vars
->
{
'operations'
})
=
$bug
->
get_activity
(
$attachment
->
id
,
$delta_ts
);
# 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.
if
(
scalar
(
@
{
$vars
->
{
'operations'
}}))
{
$cgi
->
param
(
'delta_ts'
,
$attachment
->
modification_time
);
$cgi
->
param
(
'delta_ts'
,
$modification_time
);
# The token contains the old modification_time. We need a new one.
$cgi
->
param
(
'token'
,
issue_hash_token
([
$attachment
->
id
,
$modification_time
]));
$vars
->
{
'attachment'
}
=
$attachment
;
print
$cgi
->
header
();
...
...
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