Bug 103538 - Use OpenType Sanitiser to sanitize embedded fonts
Summary: Use OpenType Sanitiser to sanitize embedded fonts
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-27 12:46 UTC by ⁨خالد حسني⁩
Modified: 2022-08-14 20:12 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ⁨خالد حسني⁩ 2016-10-27 12:46:25 UTC
LibreOffice supports embedded fonts in the documents for sometime now, and we use and pass these fonts to font rendering libraries without any checking for there validity. Fonts can be a security risk and malicious fonts can easily crash the system on several platforms.

Some web browsers (Google Chrome and Mozilla Firefox) use OpenType Sanitiser to sanitize downloadable webfonts to mitigate such risks, and I think LibreOffice should do the same.

https://github.com/khaledhosny/ots
Comment 1 V Stuart Foote 2016-10-28 01:38:18 UTC
Reasonable, +1

As long as we don't adversely affect the style definitions for documents containing the embedded fonts--assume we replace the fonts detected "corrupt" with available local font equivalent.  And I assume provide fallback for a font that has been blocked but has no local instance.  On export back to ODF archive we'd embed from the local font instance (or the fallback).
Comment 2 QA Administrators 2017-10-29 13:04:49 UTC Comment hidden (obsolete)
Comment 3 ⁨خالد حسني⁩ 2022-08-14 20:12:35 UTC
No security issue about embedded fonts in 5 years, probably not worth it.