diff options
| author | 2025-02-13 19:38:54 +0100 | |
|---|---|---|
| committer | 2025-02-13 19:38:54 +0100 | |
| commit | e237a35f0d51683511e87e68c2fe3fd9bdf3ef9e (patch) | |
| tree | 605f7dde1d92aa32c6336fef9ef349c0d9c7787a /html.c | |
| parent | Added a default MAX_JSON_DEPTH inside xs_json.h. (diff) | |
| download | penes-snac2-e237a35f0d51683511e87e68c2fe3fd9bdf3ef9e.tar.gz penes-snac2-e237a35f0d51683511e87e68c2fe3fd9bdf3ef9e.tar.xz penes-snac2-e237a35f0d51683511e87e68c2fe3fd9bdf3ef9e.zip | |
Drop SVG attachments, as they may include JavaScript.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 5 |
1 files changed, 5 insertions, 0 deletions
| @@ -2242,6 +2242,11 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2242 | if (content && xs_str_in(content, o_href) != -1) | 2242 | if (content && xs_str_in(content, o_href) != -1) |
| 2243 | continue; | 2243 | continue; |
| 2244 | 2244 | ||
| 2245 | /* drop silently any attachment that may include JavaScript */ | ||
| 2246 | if (strcmp(type, "image/svg+xml") == 0 || | ||
| 2247 | strcmp(type, "text/html") == 0) | ||
| 2248 | continue; | ||
| 2249 | |||
| 2245 | /* do this attachment include an icon? */ | 2250 | /* do this attachment include an icon? */ |
| 2246 | const xs_dict *icon = xs_dict_get(a, "icon"); | 2251 | const xs_dict *icon = xs_dict_get(a, "icon"); |
| 2247 | if (xs_type(icon) == XSTYPE_DICT) { | 2252 | if (xs_type(icon) == XSTYPE_DICT) { |