Am I affected?

type your doggo version to check

Description

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in woylie doggo allows Reflected XSS.

Doggo.normalize_value/2 in lib/doggo.ex returned date field values wrapped in {:safe, ...}, the Phoenix.HTML marker meaning "already escaped, emit verbatim", without escaping them, so the value reached the value attribute of the <input> rendered by the field component unchanged. Any application rendering <.field type="date"> over user-controlled params is affected through the ordinary Phoenix form round-trip, where a failed validation re-renders the submitted value. The pattern kept exactly the first ten bytes and discarded shorter values, capping a payload at ten bytes: enough to terminate the attribute and open an element or attach a short event handler, not enough to place attacker-chosen script inline. Only type="date" is affected.

This issue affects doggo: from 0.1.0 before 0.14.8.

Weaknesses & attack patterns

Weakness

CWE-79 · Improper Neutralization of Input During Web Page Generation in catalog → MITRE ↗

Attack patterns

CAPEC-591 · Reflected XSS MITRE ↗

Affected — Hex / doggo Hex.pm ↗ Repository ↗

≥ 0.1.0 < 0.14.8 affected
every other version: unaffected
cpe cpe:2.3:a:woylie:doggo:*:*:*:*:*:*:*:*
version type semver
modules · source files · routines
modules 'Elixir.Doggo' · 'Elixir.Doggo.Components.Field'
source files lib/doggo.ex · lib/doggo/components/field.ex
routines 'Elixir.Doggo':normalize_value/2 · 'Elixir.Doggo.Components.Field':field/1

Affected — GitHub / woylie/doggo Repository ↗

≥ ae65fed < 0161c97 affected
every other version: unaffected
cpe cpe:2.3:a:woylie:doggo:*:*:*:*:*:*:*:*
version type git
modules · source files · routines
modules 'Elixir.Doggo' · 'Elixir.Doggo.Components.Field'
source files lib/doggo.ex · lib/doggo/components/field.ex
routines 'Elixir.Doggo':normalize_value/2 · 'Elixir.Doggo.Components.Field':field/1

Workarounds

Either of these closes the hole without upgrading.

Use type="text" instead of type="date" for fields whose value can come from user-submitted params. The text branch delegates to Phoenix.HTML.Form.normalize_value/2, which returns a bare string that HEEx then escapes.

Alternatively, pass an explicit value already validated as an ISO 8601 date rather than letting the component read it from the form field, so the value reaching the unescaped branch contains no metacharacters.

References

Credits

Jonatan Männchen / EEF Coordinator
Mathias Polligkeit Remediation developer

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Exploitability

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive

Vulnerable System

Confidentiality
Low
Integrity
Low
Availability
None

Subsequent Systems

Confidentiality
None
Integrity
None
Availability
None
« All CVEs