Skip to main content

Business information leak - Credit Cards

Description

As a result of a misconfiguration in the creditcarId variable, customer credit card data can be seen through the responses to the requests made. Thus, it was possible to obtain business information, such as:

  • Strategic information.
  • Customer information.

Impact

-Obtain credit card information of current users. -List valid cards and their expiration dates.

Recommendation

According to the classification of the information found, establish the necessary controls so that the information is accessible only to the indicated persons.

Threat

External attacker with access to valid token.

Expected Remediation Time

⌚ 120 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: F
  • Remediation level: O
  • 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:F/RL:O/RC:X
  • Score:
    • Base: 4.3
    • Temporal: 4.0
  • Severity:
    • Base: Medium
    • Temporal: Medium

Code Examples

Compliant code

Credit card numbers are correctly handled by using secure encrypting algorithms

app.post('/editPaymentMethod', isLoggedIn, function(req, res, next){
User.update({ _id: req.user.id}, req.body, function(err, user){
//A credit card gets assigned a random id
creditCardId = createUuid(user);
res.message("creditCardid"+creditCardId);
res.redirect('/profile/payments');
}
});

Non compliant code

Credit card numbers are passed as plain text to variable that can be accessed

app.post('/editPaymentMethod', isLoggedIn, function(req, res, next){
User.update({ _id: req.user.id}, req.body, function(err, user){
//The credit card number gets passed to a variable without hashing
creditCardId = req.body.creditCardNumber;
res.message("creditCardid"+creditCardId);
res.redirect('/profile/payments');
}
});

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.