Skip to content
Access control Write-up Intermediate

Bypassing restricted port protection in WebKit

Safari's restricted port blocking only prevents rendering the response, but the initial request is still sent to the restricted port. An attacker could use this to send malicious commands to non-HTTP services on sensitive ports, such as mail servers.

David Schütz Follow

Published on feed.bugs.xdavidhu.me

Safari restricted port blocking is not enforced properly. When requesting a page on a restricted port, only rendering is blocked, but the initial request gets sent to the restricted port.

David Schütz, on feed.bugs.xdavidhu.me

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the port restriction is enforced only when rendering the response, not when sending the request.

Impact

This could be used to bypass the restricted port protection and send malicious commands to non-HTTP services on sensitive ports, like mail servers.

What the attacker needed

Victim uses Safari; victim visits attacker's page; victim submits a form

The fix

The issue was fixed in iOS/iPadOS 14.6, macOS Big Sur 11.4, Safari 14.1.1, watchOS 7.5 and tvOS 14.6.

How it was found

  1. Create an HTML file with a form that posts to a restricted port.
  2. Start a listener on the restricted port.
  3. Open the HTML file in Safari.
  4. Submit the form with some data.
  5. Observe Safari shows an error about the restricted port.
  6. Observe the listener receives the request.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Web browsers block certain network ports (like port 25 for email) to stop web pages from talking to sensitive services. This report shows that Safari still sends the request to those ports even though it shows an error, so a malicious page could send commands to services like mail servers.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by David Schütz

View all

6 more disclosed reports, best first.

More from Apple

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.