question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS Safari fails to lockdown (with potential fix)

See original GitHub issue
  1. Call lockdown() on the latest version of iOS Safari
  2. Lockdown fails with the error Cannot read "configurable" of undefined in the console

Digging in a bit, I found that the error is caused inside isImmuatableDataProperty():

function isImmutableDataProperty(obj, name) {
  const desc = getOwnPropertyDescriptor(obj, name)
  return (
    //
    // The getters will not have .writable, don't let the falsyness of
    // 'undefined' trick us: test with === false, not ! . However descriptors
    // inherit from the (potentially poisoned) global object, so we might see
    // extra properties which weren't really there. Accessor properties have
    // 'get/set/enumerable/configurable', while data properties have
    // 'value/writable/enumerable/configurable'.
    desc.configurable === false &&
    desc.writable === false &&
    //
    // Checks for data properties because they're the only ones we can
    // optimize (accessors are most likely non-constant). Descriptors can't
    // can't have accessors and value properties at the same time, therefore
    // this check is sufficient. Using explicit own property deal with the
    // case where Object.prototype has been poisoned.
    objectHasOwnProperty(desc, 'value')
  )
}

It is called with isImmutableDataProperty(window, 'showModalDialog'), which in iOS safari is actually undefined. So when it tries to get the property descriptor, desc is also undefined.

I added a hack to return true if desc is undefined and everything seems to work as expected. I’m not sure if that is the actual fix though.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:19 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
erightscommented, Jan 29, 2022
0reactions
karlcowcommented, Nov 2, 2022

@mhofman nope 😕 sorry.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About Lockdown Mode - Apple Support
On Mac · From the menu bar in Safari, choose the Safari menu > Settings. · Click Websites. · In the sidebar, scroll...
Read more >
Hands-on with Lockdown Mode in iOS 16 - TechCrunch
Safari says “Lockdown Mode” when the feature is switched on. You can see that TechCrunch loads fairly well and that the browser relies...
Read more >
Orion Does Not Show Up on List of Apps in Lockdown Mode ...
There is no way to exclude websites from Lockdown Mode (as there is in Safari). A quick search on https:/developer.apple.com doesn't reveal much ......
Read more >
Unable to open links in Safari, Mail or Messages on iOS 9.3
Short version: there is currently no fix for this – we're waiting on Apple to resolve. A reboot sometimes temporarily fixes the issue,...
Read more >
Safe Exam Browser - News
Fix for "Back to Safari" button/link function in visible Status Bar on iOS 14 before 14.5 in AAC kiosk mode. Optional features, which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found