Skip to main content

Lack of data validation - Type confusion


A field is interpreted on the server-side, although it indicates that it only accepts numbers, it allows values in the form 0xff.


  • Get internal information about the operation of the system.
  • Inject code and get it interpreted by the server.


Validate on the server-side the data types that are entered but prevent them from being interpreted.


Authorized user from intranet.

Expected Remediation Time

⌚ 30 minutes.


Default score using CVSS 3.1. It may change depending on the context of the vulnerability.


  • Attack vector: A
  • Attack complexity: L
  • Privileges required: L
  • User interaction: N
  • Scope: U
  • Confidentiality: N
  • Integrity: L
  • Availability: N


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


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

Code Examples

Compliant code

Verify types of user inputs to avoid problems on the server side

import (

func SafeFloat(request *http.Request) {
amount := strconv.ParseFloat(request.Amount)
if math.IsNaN(amount) || math.IsInf(amount, 0) {
return "Not a valid value"
sql.QueryRow(`INSERT INTO tbl $1`, amount)

Non compliant code

The application includes functions that could be penetrated because of type confusion

import (

func DangerousFloat(request *http.Request) {
amount := strconv.ParseFloat(request.Amount)
sql.QueryRow(`INSERT INTO tbl $1`, amount)