phanalist

E0046: Input-Controlled Cardinality

E0046 reports request-controlled values that reach loops, allocation sinks, or callees without a bound. Cardinality is separate from taint: a value may be tainted without controlling collection size, and an input-controlled collection may contain ordinary strings.

What it checks

E0046 findings identify the source, such as $_GET or php://input, and the sink. They do not claim that the input is malicious; they identify a missing bound or validation step.

Model limits

Input cardinality is tracked with a conservative taint-and-size model, not with full PHP type inference. The following can cause missed or additional findings:

Configuration

rules:
  E0046:
    runtime_threshold: quadratic
    heap_alloc_threshold: quadratic
    retained_element_bytes: 32
    report_input_cardinality: true
    include_cli_input: false
    max_findings_per_function: 20

Set report_input_cardinality: false to suppress E0046 findings while keeping E0044 and E0045 active. max_findings_per_function limits duplicate findings in one function body.