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
36253a71
Commit
36253a71
authored
8 years ago
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1259881 - CSV export vulnerable to formulae injection (again)
r=sgreen a=dkl
parent
94d623c0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Template.pm
Bugzilla/Template.pm
+4
-3
No files found.
Bugzilla/Template.pm
View file @
36253a71
...
...
@@ -713,12 +713,13 @@ sub create {
},
# In CSV, quotes are doubled, and any value containing a quote or a
# comma is enclosed in quotes. If a field starts with an equals
# sign, it is proceed by a space.
# comma is enclosed in quotes.
# If a field starts with either "=", "+", "-" or "@", it is preceded
# by a space to prevent stupid formula execution from Excel & co.
csv
=>
sub
{
my
(
$var
)
=
@_
;
$var
=
' '
.
$var
if
substr
(
$var
,
0
,
1
)
eq
'='
;
$var
=
' '
.
$var
if
$var
=~
/^[+=@-]/
;
# backslash is not special to CSV, but it can be used to confuse some browsers...
# so we do not allow it to happen. We only do this for logged-in users.
$var
=~
s/\\/\x{FF3C}/g
if
Bugzilla
->
user
->
id
;
...
...
This diff is collapsed.
Click to expand it.
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