Skip to main content

Administrative credentials stored in cache memory

Description

It is possible to retrieve administrative credentials from the systems cache memory.

Impact

Obtain functional credetials for privileged users.

Recommendation

Avoid the store of sensitive information in temporary files or cache.

Threat

Authenticated attacker from local network.

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: L
  • Attack complexity: H
  • Privileges required: H
  • User interaction: N
  • Scope: C
  • Confidentiality: H
  • Integrity: N
  • Availability: N

Temporal

  • Exploit code madurity: H
  • Remediation level: U
  • Report confidence: C

Result

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

Code Examples

Compliant code

Use secure verification methods like correctly set up cookies for session storage

// Use cookies to avoid storing sensitive information
function setCookie(cname, cvalue, exdays) {
const d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
let expires = "expires="+ d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}

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

Non compliant code

The application uses functionalities like local storage to save sensitive data like a user password

localStorage.setItem('password',user_password);

Requirements