|
| 1 | +--- |
| 2 | +gem: icalendar |
| 3 | +cve: 2026-33635 |
| 4 | +ghsa: pv9c-9mfh-hvxq |
| 5 | +url: https://github.com/icalendar/icalendar/security/advisories/GHSA-pv9c-9mfh-hvxq |
| 6 | +title: iCalendar has ICS injection via unsanitized URI property values |
| 7 | +date: 2026-03-24 |
| 8 | +description: | |
| 9 | + ### Summary |
| 10 | +
|
| 11 | + .ics serialization does not properly sanitize URI property values, |
| 12 | + enabling ICS injection through attacker-controlled input, adding |
| 13 | + arbitrary calendar lines to the output. |
| 14 | +
|
| 15 | + ### Details |
| 16 | +
|
| 17 | + `Icalendar::Values::Uri` falls back to the raw input string when |
| 18 | + `URI.parse` fails and later serializes it with `value.to_s` without |
| 19 | + removing or escaping `\r` or `\n` characters. That value is embedded |
| 20 | + directly into the final ICS line by the normal serializer, so a |
| 21 | + payload containing CRLF can terminate the original property and |
| 22 | + create a new ICS property or component. (It looks like you can |
| 23 | + inject via url, source, image, organizer, attach, attendee, |
| 24 | + conference, tzurl because of this) |
| 25 | +
|
| 26 | + Relevant code: |
| 27 | + - `lib/icalendar/values/uri.rb:16` |
| 28 | +
|
| 29 | + ### Impact |
| 30 | +
|
| 31 | + Applications that generate `.ics` files from partially untrusted |
| 32 | + metadata are impacted. As a result, downstream calendar clients |
| 33 | + or importers may process attacker-supplied content as if it were |
| 34 | + legitimate event data, such as added attendees, modified URLs, |
| 35 | + alarms, or other calendar fields. |
| 36 | +
|
| 37 | + ## Fix |
| 38 | +
|
| 39 | + Reject raw CR and LF characters in `URI`-typed values before |
| 40 | + serialization, or escape/encode them so they cannot terminate |
| 41 | + the current ICS content line. |
| 42 | +cvss_v3: 4.3 |
| 43 | +unaffected_versions: |
| 44 | + - "< 2.0.0" |
| 45 | +patched_versions: |
| 46 | + - ">= 2.12.2" |
| 47 | +related: |
| 48 | + url: |
| 49 | + - https://github.com/icalendar/icalendar/security/advisories/GHSA-pv9c-9mfh-hvxq |
| 50 | + - https://github.com/icalendar/icalendar/commit/b8d23b490363ee5fffaec1d269a8618a912ca265 |
| 51 | + - https://github.com/advisories/GHSA-pv9c-9mfh-hvxq |
0 commit comments