Skip to main content

Authentication mechanism absence or evasion - Redirect

Description

An attacker can gain access to the application by knowing a valid username by changing the redirect with which the server responds.

Impact

  • Bypass the authentication process by changing the page redirection and thus gain access to the applications functionality.
  • Know a valid user.
  • Change the redirect and access the application.

Recommendation

Put in place for every resource with business-critical functionality a strong authentication process and ensure that every user attempting to access it is logged in.

Threat

Anonymous attacker from the Internet.

Expected Remediation Time

⌚ 60 minutes.

Score

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

Base

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

Temporal

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

Result

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

Code Examples

Compliant code

The application checks user credentials before accessing sensitive resources

const accessCredentials = (req, res) => {
//Redirect the user to sensitive page only if it has access
if (isValidUser(req.body.user) && isAuthorizedUser(req.body.user)) {
res.redirect('/profile/credentials');
}
}

Non compliant code

The application allows to redirect the user to a private page without checking the authorization

const accessCredentials = (req, res) => {
if (isValidUser(req.body.user)) {
res.redirect('/profile/credentials');
}
}

Requirements