Skip to main content

Insufficient data authenticity validation - Checksum verification

Description

The application does not properly validate the integrity of resources uploaded from external servers.

Impact

Use third-party resources without verifying that the integrity has not been compromised.

Recommendation

Validate the integrity of all resources originating from sources controlled by third parties.

Threat

Anonymous attacker from Internet with write access to a resource used by the application.

Expected Remediation Time

⌚ 15 minutes.

Score

Default score using CVSS 3.1. It may change depending on the context of the vulnerability.

Base

  • Attack vector: N
  • Attack complexity: H
  • Privileges required: N
  • User interaction: N
  • Scope: U
  • Confidentiality: N
  • Integrity: L
  • Availability: N

Temporal

  • Exploit code madurity: U
  • Remediation level: O
  • Report confidence: X

Result

  • Vector string: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N/E:U/RL:O/RC:X
  • Score:
    • Base: 3.7
    • Temporal: 3.2
  • Severity:
    • Base: Low
    • Temporal: Low

Code Examples

Compliant code

All inputs are correctly validated on the server side before being used

app.post('/editProfile', isLoggedIn, function(req, res, next){
User.update({ _id: req.user.id}, req.body, function(err, user){
user.facebookProfileUrl = req.body.Url;
headerUpdate = downloadData(req.body.url, "header");
if isValidHeader(headerUpdate){
user.facebookHeader = headerUpdate;
}
res.redirect('/profile/');
}
});

Non compliant code

The application does not perform server side validation of the input data

app.post('/editProfile', isLoggedIn, function(req, res, next){
User.update({ _id: req.user.id}, req.body, function(err, user){
//Using data from a third party without validating
user.facebookProfileUrl = req.body.Url;
user.facebookHeader = downloadData(req.body.url, "header");
res.redirect('/profile/');
}
});

Requirements