Skip to main content

Lack of data validation - Dates

Description

The application does not control on the server side that you have permission to modify certain fields, on the front end there are restrictions but it is possible to ignore them and send requests that the server does not validate and process as valid requests.

Impact

Generate the history of all movements associated with a product number, in some cases it could generate availability problems.

Recommendation

Validate on the server side the data that is entered before processing the received request.

Threat

Unauthorized user with access to the application.

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

Temporal

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

Result

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

Code Examples

Compliant code

The application uses user input after validating on the server side

function dateReq((request *http.Request) {
startDate = request.startDate;
endDate = request.endDate;
//Function to validate date ranges are allowed
if isValidDate(startDate) & isValidDate(endDate){
transactions = getTransactionInfo(startDate, endDate);
return transactions;
}else{
return None;
}
}

Non compliant code

The application uses user input without server side validation

function erroneousDateReq(request *http.Request) {
transactions = getTransactionInfo(request.startDate, request.endDate);
return transactions;
}

Requirements