Skip to main content

Insecure object reference - Financial information

Description

Although the requests for inquiry of expenses and movements associated with a credit card send the encrypted product number, it is possible to make the inquiry from the session of an account other than the one associated with the credit card.

Impact

Obtain expense information from other users.

Recommendation

Verify that the user who is trying to access the information has the necessary permissions to do so.

Threat

Authorized user from the Internet with access to the encrypted product number.

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: N
  • Attack complexity: L
  • Privileges required: L
  • 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:L/UI:N/S:U/C:L/I:N/A:N/E:X/RL:X/RC:X
  • Score:
    • Base: 4.3
    • Temporal: 4.3
  • Severity:
    • Base: Medium
    • Temporal: Medium

Code Examples

Compliant code

The application correctly verifies user authorization credentials before accesing sensitive information

const getQueryConsult = (req, res) => {
if (!isValidQuery(req.body.user, req.body.product)) {
const expensesReport = getReport(req.body.query, encrypt(req.body.product))
//As en example, you could verify that the owner of the report is the same as the user associated with the query
if(expensesReport.owner = req.body.userCredentials){
return expensesReport;
}
}
}

Non compliant code

The application grants access to sensitive information without verifying authorization credentials

const getQueryConsult = (req, res) => {
if (!isValidQuery(req.body.user, req.body.product)) {
//Getting and returning user credentials only based on the product
const expensesReport = getReport(req.body.query, encrypt(req.body.product))
return expensesReport
}
}

Requirements