Skip to main content

Non-encrypted confidential information - Local data

Description

Confidential firebase data is stored in plain text on the devices local storage allowing an attacker who has access to the physical device and bypasses the device security mechanism to view it without any encryption in case of theft or loss.

Impact

Obtain firebase credentials to compromise more resources or services.

Recommendation

Encrypt all sensitive information that is transported or stored within the application according to the organizations policies.

Threat

Unauthorized attacker with physical access to device.

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

Temporal

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

Result

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

Code Examples

Compliant code

There are no unencrypted sensitive credentials stored in the source code

import { initializeApp } from 'firebase/app';
import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';

const firebaseConfig = {
//Configuration encrypted through secure methods
};

const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

async function getUsers(db) {
....
}

Non compliant code

A resource has the access credentials insecurely stored in the source code

import { initializeApp } from 'firebase/app';
import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';

const firebaseConfig = {
const ADMIN = "admin";
const PASSWORD = "1234"
};

const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

async function getUsers(db) {
....
}

Requirements