News for hackers. Stuff that matters.
Re:A Faster Facebook for iOS by raganwald on Thursday August 23, 2012 @02:16PM (#4423985)
That issue is not as simple as you make it out to be. Just in time compilation of Javascript requires an app to have permission to execute code that is generated as data on the fly. Applications with this permission are vulnerable to exploits.

The standard UIWebView available to applications doesn't include just-in-time compilation because 3rd party applications don't have this permission. This is the biggest reason why its Javascript engine is slower than the one built into Safari.

Apple doesn't want you building apps that open up exploit vectors into iOS.

Re:A Faster Facebook for iOS by MatthewPhillips on Thursday August 23, 2012 @02:37PM (#4424090)
If it really is an engineering challenge it needs to be fixed. We're going on 2 years of Mobile Safari having JIT and UIWebView not having it. They can simply make an exception for UIWebViews without making an exception for the rest of the app. I don't know their codebase and it might be really really hard to fix, but I hope it isn't something they've given up on. It cannot continue in perpetuity, as the web cannot continue to evolve if the makers of one of the most popular browsers have given up on speed improvements.
Re:A Faster Facebook for iOS by Xuzz on Thursday August 23, 2012 @02:40PM (#4424102)
No they can't: part of a process cannot create executable memory while another part cannot. They'd have to move WebKit completely out of process: a huge task as it already does most text drawing.
Re:A Faster Facebook for iOS by raganwald on Thursday August 23, 2012 @03:26PM (#4424381)
An interesting alternative would be to enhance the current 'Save to Home Page' feature beyond specifying a manifest of resources and a home page icon. If this was fattened up to allow developers to make something that looked even more like an app but was running Safari (not a UIWebkitView inside a native app), you might have something interesting.

Pure conjecture on my part.

Re:A Faster Facebook for iOS by hokkos on Thursday August 23, 2012 @03:12PM (#4424303)
A task that they are doing with http://trac.webkit.org/wiki/WebKit2
Re:A Faster Facebook for iOS by kalleboo on Thursday August 23, 2012 @10:55PM (#4425987)
Which is what Safari does on OS X.
Re:A Faster Facebook for iOS by MatthewPhillips on Thursday August 23, 2012 @02:49PM (#4424159)
> They'd have to move WebKit completely out of process

Then that's what they need to do, JIT is a requirement for fast JavaScript and 2012 JS speeds cannot be the end of the line.

Re:A Faster Facebook for iOS by aboodman on Thursday August 23, 2012 @02:28PM (#4424039)
But it's OK to write web pages that do?
Re:A Faster Facebook for iOS by guan on Thursday August 23, 2012 @03:50PM (#4424480)
No, but web pages (including apps that are installed to the home screen and run full screen) run inside the MobileSafari process, which is much more carefully audited than your typical iOS app.
Re:A Faster Facebook for iOS by aboodman on Thursday August 23, 2012 @05:59PM (#4425074)
Audited how? Unless MobileSafari is itself tightly sandboxed, I don't see how auditing the code inside it is useful. Once you get malicious executable code inside MobileSafari, it can do whatever MobileSafari can do.

Edit: I think a better hypothesis is that Apple wants to be able to analyze app code, and thus disallows executable memory, which also rules out JITs. See: http://apple.slashdot.org/comments.pl?sid=2044470&cid=35...

Re:A Faster Facebook for iOS by raganwald on Thursday August 23, 2012 @06:55PM (#4425310)
I doubt they're trying to audit behaviour, you can always write an app in Lua with an interpreter and they would have a hard time "auditing" the app statically.

The propblem is that if you allow executable memory you open aup a lot of exploit vectors. Now, that's true of Mobile Safari as well, but they trust their own team more than they trust you, and they have one app to watch instead of 100,000, and if an exploit os found they can push out a fix immediately, whereas 3rd party apps have a tortuous process for pushing out bug fixes.

Remember, it's part of their value proposition that apps from the app store appear to be relatively safe in comparison to the clusterfuck that is downloading random desktop apps, especially on Windows.

Re:A Faster Facebook for iOS by MatthewPhillips on Thursday August 23, 2012 @05:48PM (#4425033)
Can you give an example of an exploit that would do harm from within a UIWebView but would not do harm from within Mobile Safari? Not questioning you, I'm genuinely interested.
Re:A Faster Facebook for iOS by raganwald on Thursday August 23, 2012 @06:51PM (#4425294)
Given the current architecture, if UIWebkitView within an application can execute data, then the entire application can execute data.

So you could have a buffer overrun anywhere in the app. For example, if they are silly, you could go to the preferences for Facebook and enter a very, very, very long user name, overrun the name buffer, and have executable code.

That's not an exploit of UIWebkitView, it's an exploit of giving the application the permission it needs to have UIWebkitView use a JIT compiler for JS.