Skip to main content

Insecure functionality - Masking

Description

The system is not masking the data in the request and/or response, allowing sensitive and confidential information to be known.

Impact

Become aware of sensitive and/or confidential user information.

Recommendation

The system sends sensitive information through a channel or method that does not guarantee its confidentiality or integrity.

Threat

Anonymous attacker from adjacent network running a MitM.

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

Temporal

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

Result

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

Code Examples

Compliant code

Sensitive user information is sent masked

const accessRecoveryEmail = (req, res) => {
if (isValidUser(req.body.user)) {
if (validateToken == req.body.token){
//Implement a function to mask sensitive information
const recoveryEmail = getRecoveryEmail(req.body.userId);
const maskedEmail = MaskData.maskJSONFields(recoveryEmail, maskJSONOptions);
res.end(maskedEmail);
}
}
}

Non compliant code

The application sends potential sensitive information without masking

const accessRecoveryEmail = (req, res) => {
if (isValidUser(req.body.user)) {
if (validateToken == req.body.token){
//Sending unmasked sensitive information
const recoveryEmail = getRecoveryEmail(req.body.userId);
res.end(recoveryEmail);
}
}
}

Requirements

free trial

Search for vulnerabilities in your apps for free with our automated security testing! Start your 21-day free trial and discover the benefits of our Continuous Hacking Machine Plan. If you prefer a full service that includes the expertise of our ethical hackers, don't hesitate to contact us for our Continuous Hacking Squad Plan.