Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CloudComputing_Act1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jesus Galaz Reyes
CloudComputing_Act1
Commits
d4837dbd
Commit
d4837dbd
authored
6 months ago
by
Jesus Galaz
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Trying to fix vulnerability issues"
This reverts commit
53b64634
.
parent
53b64634
No related branches found
Branches containing commit
No related tags found
Loading
Pipeline
#15727
passed
6 months ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server.js
+0
-15
0 additions, 15 deletions
server.js
with
0 additions
and
15 deletions
server.js
+
0
−
15
View file @
d4837dbd
...
@@ -2,7 +2,6 @@ const express = require('express');
...
@@ -2,7 +2,6 @@ const express = require('express');
const
path
=
require
(
'
path
'
);
const
path
=
require
(
'
path
'
);
const
connectDB
=
require
(
'
./mongodb
'
);
const
connectDB
=
require
(
'
./mongodb
'
);
const
session
=
require
(
'
express-session
'
);
const
session
=
require
(
'
express-session
'
);
const
url
=
require
(
'
url
'
);
const
app
=
express
();
const
app
=
express
();
...
@@ -10,20 +9,6 @@ const app = express();
...
@@ -10,20 +9,6 @@ const app = express();
app
.
use
(
express
.
json
());
app
.
use
(
express
.
json
());
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'
public
'
)));
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'
public
'
)));
// Allow only localhost for SSRF protection
function
validateLocalhost
(
req
,
res
,
next
)
{
const
remoteAddress
=
req
.
connection
.
remoteAddress
;
// Allow requests only from localhost (IPv4 and IPv6)
if
(
remoteAddress
!==
'
127.0.0.1
'
&&
remoteAddress
!==
'
::1
'
)
{
return
res
.
status
(
403
).
send
(
'
External requests are forbidden
'
);
}
next
();
}
app
.
use
(
validateLocalhost
);
// Add the middleware
// Session configuration
// Session configuration
app
.
use
(
app
.
use
(
session
({
session
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment