News for hackers. Stuff that matters.
Re:iPadOS by saagarjha on Tuesday September 24, 2019 @01:20PM (#21062450)
> In any case, I don't think there can be any opposing arguments on the side of security for Apple not updating Safari via AppStore or now allowing proper 3rd party browsers.

Third party browsers entitled with dynamic codesigning poke a huge hole in Apple's security model for iOS devices.

Re:iPadOS by Abishek_Muthian on Tuesday September 24, 2019 @01:49PM (#21062768)
That doesn't explain why it fails to update Safari via AppStore.

Also Apple has been allowing coding apps for years now which can download and run executable code, so it is hard to buy the argument.

Re:iPadOS by saagarjha on Tuesday September 24, 2019 @02:05PM (#21062967)
> That doesn't explain why it fails to update Safari via AppStore.

Another reason is that it's extra work to decouple the browser with the OS.

> Also Apple has been allowing coding apps for years now which can download and run executable code, so it is hard to buy the argument.

Not native code.

Re:iPadOS by Abishek_Muthian on Tuesday September 24, 2019 @02:11PM (#21063027)
> it's extra work to decouple the browser with the OS.

It is expected of a company which boasts about security and privacy of its users as a premium selling point, although it is questionable now[1]. Besides, MacOS has been receiving Safari updates separately.

Also android has been decoupling several system services with every iteration now, soon crucial system services would be updated from PlayStore and so even if the manufacturer doesn't ship OS updates, important services would stay updated.

[1]: https://arstechnica.com/information-technology/2019/09/apple...

Re:iPadOS by saagarjha on Wednesday September 25, 2019 @02:33AM (#21068272)
> Besides, MacOS has been receiving Safari updates separately.

Sure, but the company is doing extra work to provide this. It might be a worthwhile decision to make but it’s certainly not a free gain.

Re:iPadOS by eyo2019 on Tuesday September 24, 2019 @02:16PM (#21063072)
> Another reason is that it's extra work to decouple the browser with the OS.

I thought that argument was rejected already in 2001[0].

[0]: https://en.wikipedia.org/wiki/United_States_v._Microsoft_Cor....

---

(edited to fix link formatting)

Re:iPadOS by Spivak on Tuesday September 24, 2019 @05:44PM (#21064950)
There is a bit of nuance here. IE today still isn’t decoupled from Windows. MS has been shoving it into an ever smaller corner of Windows but IE is the OS provided webview for a lot of old crusty applications that needed to render HTML.

What they’re talking about is IE the OS component didn’t mean that IE the user-facing general-purpose browser had to be the default.

Re:iPadOS by criddell on Tuesday September 24, 2019 @04:04PM (#21064041)
Microsoft was in a far different market position than Apple.
Re:iPadOS by csande17 on Tuesday September 24, 2019 @02:41PM (#21063307)
Doesn't the Swift Playgrounds app let you download, compile, and run Swift code?
Re:iPadOS by saagarjha on Tuesday September 24, 2019 @03:32PM (#21063705)
It does, and it has special entitlements to let it do so.
Re:iPadOS by SSLy on Tuesday September 24, 2019 @04:33PM (#21064324)
>Another reason is that it's extra work to decouple the browser with the OS.

MS made the exact same argument 15 years ago.

Re:iPadOS by Spivak on Tuesday September 24, 2019 @05:39PM (#21064915)
And it’s still true 15 years later. They still haven’t been able to decouple IE for all the random crap that uses it. They’ve shoved the user facing interface into a dark corner hoping everyone forgets about it but it’s still there.
Re:iPadOS by rictic on Tuesday September 24, 2019 @01:50PM (#21062783)
Do you mean the ability to dynamically allocate executable memory? That's not necessary for shipping a browser engine (though performance would suffer, as that's how all modern JS VMs work, via jitting JS to machine code).
Re:iPadOS by saagarjha on Tuesday September 24, 2019 @02:02PM (#21062942)
Yes. It's not necessary for a browser engine to do this, of course, but AFAIK the best interpreters can only approach or barely match simple templating JITs so you're probably not going to be able to write a competitive browser without this.
Re:iPadOS by Jyaif on Tuesday September 24, 2019 @01:44PM (#21062717)
Can you explain why allowing apps to ship with a JIT compiler be a security issue?
Re:iPadOS by Someone on Tuesday September 24, 2019 @02:04PM (#21062957)
A common attack method is to overwrite the stack or some buffer and then somehow make the CPU run the bytes written as code (https://en.wikipedia.org/wiki/Buffer_overflow#Exploitation, https://en.wikipedia.org/wiki/Buffer_overflow#Heap-based_exp...)

A common mitigation to that is “write xor execute” (https://en.wikipedia.org/wiki/W%5EX)

From that page: ”Without such protection, a program can write (as data) CPU instructions in an area of memory intended for data and then arrange to run (as executable) those instructions. This can be dangerous if the writer of the memory is malicious.”

JIT compilers are collateral damage to that mitigation; they have to write bytes to memory and then make the CPU run those bytes as code, and W^X doesn’t allow that.

Re:iPadOS by saagarjha on Tuesday September 24, 2019 @02:21PM (#21063126)
FWIW, switching memory from RW- to R-X (which is still W^X) is also not allowed unless you have certain, easier to get entitlements.
Re:iPadOS by acdha on Tuesday September 24, 2019 @01:59PM (#21062908)
Think about what a JIT compiler means: it's allocating memory, writing to it, and then executing it. That's also what malware does so if you give third parties access to that functionality you have the immediate problem that the number of people who can make a mistake which gives native code execution goes up dramatically and that any attempts to restrict it in the future will risk breaking previously-working apps — think about how many years Adobe was able to slack because nobody wanted to break Flash even though it was a huge source of security bugs affecting most people on the Internet.
Re:iPadOS by saagarjha on Tuesday September 24, 2019 @02:04PM (#21062960)
Apple's security model for iOS, as far as I can tell, is to be able to analyze all executable code in applications at review time. Being able to dynamically generate code does not work with this policy.
Re:iPadOS by vbezhenar on Tuesday September 24, 2019 @02:43PM (#21063316)
Apple libraries use private APIs but developers must not use them directly. If you allow developers to execute arbitrary bytes, they can submit app which does not call private API but will be able to call them later after approve. JavaScript is safe, because it can't call C API, but arbitrary JIT engine is not.
Re:iPadOS by fragmede on Tuesday September 24, 2019 @02:57PM (#21063443)
Sandboxing a JIT compiler is impossible to do perfectly, so there will always be the possibility of a sandbox escape, allowing the device to be jailbroken; but alsio for bad actors to take control of the device.
Re:iPadOS by tpetry on Tuesday September 24, 2019 @01:46PM (#21062733)
They could limit this functionality to only their apps. No problem.
Re:iPadOS by saagarjha on Tuesday September 24, 2019 @01:48PM (#21062766)
That wouldn't work for third-party browsers.