|
YAACC - UPNP Client and Server
|
Which http/https link targets the share intake accepts. More...

Static Public Member Functions | |
| static boolean | isAllowedTarget (String url, Set< String > ownAddresses) |
Which http/https link targets the share intake accepts.
Plain Java, no android.*.
A shared link is fetched by the phone (through the media proxy) or played from the phone, so a hostile link must not point the phone at itself or at link-local addresses (cloud metadata style endpoints, the loopback services of other apps). Private LAN ranges stay allowed: the typical share is a NAS or a media server.
The host is taken from the text by hand: no URL, URI or InetAddress, so nothing is resolved and no DNS request is made. Rejected (fail closed):
HttpLinkTarget#isFetchable(String)); 127.0.0.0/8, 0.0.0.0/8 (includes the unspecified address), link-local 169.254.0.0/16; IPv6 ::1, ::, fe80::/10, and IPv4 addresses hidden in IPv6 (mapped ::ffff:a.b.c.d, the deprecated compatible form ::a.b.c.d, NAT64 64:ff9b::a.b.c.d); a zone id is rejected as a percent sign; localhost and every *.localhost, any case, with or without a trailing dot; ownAddresses, normalized by ProxyAccessPolicy#normalizeAll; host names in that set are ignored); 2130706433, 0177.0.0.1, 0x7f.1, 127.1. A host whose last label is numeric (decimal digits, or 0x and hex digits) must be a strict dotted-decimal address (four parts, no leading zeros), else it is rejected; The authority is what follows the LAST @ before the first /, ? or #, so http://good@127.0.0.1/ is loopback and http://127.0.0.1:80@evil/ is evil.
|
static |
| url | the link as text, may be null |
| ownAddresses | the phone's own IP addresses as text (brackets, zone ids and mapped forms are normalized); may be null |
Referenced by de.yaacc.upnp.UpnpClient.createPlayableItem().

