• Stars
    star
    881
  • Rank 51,441 (Top 2 %)
  • Language
    Swift
  • Created over 1 year ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Proof-of-concept app to overwrite fonts on iOS using CVE-2022-46689.

Proof-of-concept app to overwrite fonts on iOS using CVE-2022-46689.

Works on iOS 16.1.2 and below (tested on iOS 16.1) on unjailbroken devices.

IPA available in the Releases section.

Fonts included:

  • DejaVu Sans Condensed
  • DejaVu Serif
  • DejaVu Sans Mono
  • Go Regular
  • Go Mono
  • Fira Sans
  • Segoe UI
  • Comic Sans MS
  • Choco Cooky

You can also import custom fonts that were ported for iOS.

Screenshots

DejaVu Sans Condensed | DejaVu Serif | DejaVu Sans Mono | Choco Cooky

Screenshot

Go Regular | Go Mono | Segoe UI | Comic Sans MS

Another screenshot

Hanna Soft + JoyPixels | Bronkoh | Noto Serif SC | Fira Sans

Another screenshot

Screenshot credit: @ev_ynw for the ported Hanna Soft and Bronkoh fonts, JoyPixels for the emoji font

Where to find ported fonts

Known issues

  • The built-in fonts are not properly ported (I don't know how to port fonts). For best results, use a custom font.
    • with the built-in fonts:
    • Only regular text uses the changed font: thin/medium/bold text falls back to Helvetica instead.
    • If the font doesn't show up at all, disable "Bold Text" in accessibility settings.
  • File pickers in apps will fail to open with the error "Something went wrong while displaying documents."
    • This happens if you replace the emoji font, or install fonts with multiple weights
    • Try the experimental .ttc fix by using "Import custom with fix for .ttc"
  • iOS 14.x devices which are jailbroken / were jailbroken before will not be able to revert to the original font.
    • Workaround: do not use this app if you're on iOS 14.x and have previously jailbroken. Instead, just jailbreak and replace fonts normally.

Font conversion

The CVE-2022-46689 issue - as far as I know - only lets you overwrite 16383 bytes out of every 16384 bytes: the last byte of the page can't be written.

(I could be wrong)

To work around this, I package the font using the WOFF2 webfont format, which is supported on iOS. WOFF2 uses Brotli for compression, which lets me insert padding to skip over the last byte.

See repackfonts/make_woff2src.sh for details: this script:

  • renames the font to .SFUI-Regular with TTX following this answer
  • rebuilds the font to .woff2
  • runs repackfonts/BrotliPadding.swift to decompress the WOFF2 file and insert padding to skip past the 16384th byte

Credits

  • Ian Beer of Project Zero for finding CVE-2022-46689.
  • Apple for the test case and patch. (I didn't change anything: I only wrapped the test case in a library.)
  • Everyone on Twitter who helped out and experimented with CVE-2022-46689, especially @dedbeddedbed, @AppleDry05, and @haxi0sm for exploring what can be done with this issue..
  • WOFF2 compressor by Google
  • ttcpad by LIJI32
  • Fontforge stripttc
  • The DejaVu fonts are distributed according to their license.
  • The Go fonts are distributed according to their license.
  • The Fira Sans font is converted by @jonpalmisc - thanks!
  • Segoe UI and Comic Sans MS are the property of Microsoft.
  • Choco Cooky is the property of Samsung.
  • I don't have any rights to redistribute these, but I'm posting them anyways because #yolo.

More Repositories

1

YTMusicUltimate

The best tweak for YouTube Music iOS.
Logos
584
star
2

Dodo

The perfect Lock Screen redesign
Swift
29
star
3

NotchBanners

Swift
27
star
4

iLocalConnect

A macOS tool to help you ssh over usb to your idevices.
Swift
26
star
5

Comet

A framework for writing SwiftUI preferences in jailbreak tweaks
Swift
23
star
6

RAMUnderTime

Shows the amount of free ram under the time in the status bar.
Swift
20
star
7

ProtectedBrowser

Prevent JS injection on third party in-app browsers (instagram, TikTok, etc).
Swift
19
star
8

PowerWidget

PowerWidget tweak for iOS 14+
Logos
18
star
9

ginsudev

17
star
10

Recents

Show recently opened apps on the Home Screen!
Swift
17
star
11

DockSearch

Adds a browser search bar to the iOS dock.
Swift
16
star
12

DrainCheck

Monitor your battery drain on iOS
Swift
16
star
13

KillControl

An all in one solution to killing your apps. Swipe down to kill + more!
Swift
14
star
14

RouteConfigurator

Specify preferred audio routes for different apps
Logos
13
star
15

Gradi

A Swift/SwiftUI media player for jailbroken iOS devices.
Swift
13
star
16

WeatherLS

Shows the weather on the Lock Screen.
Swift
12
star
17

repo

Repository / Website for jailbreak packages.
Shell
10
star
18

PocketTranslator

A window you can present anywhere to translate anything.
Swift
8
star
19

DockLS

Swift
7
star
20

GSCore

Shared services and communication between my tweaks
Swift
5
star
21

InvisibleWidget

Shell
5
star
22

GSWeather

Weather fetching framework in Combine
Swift
3
star
23

danners

lightweight + native dark banners
Makefile
3
star
24

NativeDepictionGenerator

Used to generate native depictions for packages in my repo/website
Swift
2
star
25

DualClock

Two time zones on the Lock Screen!
Swift
1
star
26

SwiftFastText

fastText cpp library wrapper in Swift
C++
1
star
27

GSRouting

Supercharge your SwiftUI navigation
Swift
1
star