Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
68ed889f
Commit
68ed889f
authored
Mar 10, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check if request data contains "..", which would mean user wanna walk in my filesystem
parent
f51e68d2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
debomatic-webui/lib/utils.js
debomatic-webui/lib/utils.js
+9
-3
No files found.
debomatic-webui/lib/utils.js
View file @
68ed889f
...
@@ -3,16 +3,22 @@ var path = require('path')
...
@@ -3,16 +3,22 @@ var path = require('path')
,
Tail
=
require
(
'
tail
'
).
Tail
,
Tail
=
require
(
'
tail
'
).
Tail
,
config
=
require
(
'
./config.js
'
)
,
config
=
require
(
'
./config.js
'
)
function
__check_no_backward
(
backward_path
)
{
try
{
return
backward_path
.
indexOf
(
'
..
'
)
<
0
}
catch
(
err
)
{
return
true
}
}
function
__check_data_distribution
(
data
)
{
function
__check_data_distribution
(
data
)
{
return
data
&&
data
.
distribution
&&
data
.
distribution
.
name
return
__check_no_backward
(
data
)
&&
__check_no_backward
(
data
.
distribution
)
&&
__check_no_backward
(
data
.
distribution
.
name
)
}
}
function
__check_data_package
(
data
)
{
function
__check_data_package
(
data
)
{
return
__check_data_distribution
(
data
)
&&
data
.
package
&&
data
.
package
.
name
&&
data
.
package
.
version
return
__check_data_distribution
(
data
)
&&
__check_no_backward
(
data
.
package
)
&&
__check_no_backward
(
data
.
package
.
name
)
&&
__check_no_backward
(
data
.
package
.
version
)
}
}
function
__check_data_file
(
data
)
{
function
__check_data_file
(
data
)
{
return
__check_data_package
(
data
)
&&
data
.
file
&&
data
.
file
.
name
return
__check_data_package
(
data
)
&&
__check_no_backward
(
data
.
file
)
&&
__check_no_backward
(
data
.
file
.
name
)
}
}
function
__get_distribution_pool_path
(
data
)
{
function
__get_distribution_pool_path
(
data
)
{
...
...
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