Skip to main content

Improper authorization control for web services

Description

The systems web services do not have an authorization control mechanism or the one in place can be bypassed.

Impact

Obtain confidential information from users.

Recommendation

Validate through session cookies or tokens that users trying to access certain information are authenticated.

Threat

Anonymous attacker from the Internet.

Expected Remediation Time

⌚ 30 minutes.

Score

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

Base

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

Temporal

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

Result

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

Code Examples

Compliant code

Correct use of cookies to restore session contents

// Get cookie to restore session credentials
function restoreSession(cname){
userCookie = getcookies(cname);
if(userCookie){
restoreSession(user);
}
}

Non compliant code

In this case, the userId is used to access sensitive session information, without verifying cookies

// Get cookie to restore session credentials
function restoreSession(cname){
userCredentials = fetch('myurl/${userId}')
restoreSession(userCredentials)
}

Requirements