Skip to content

Comment out updateJSONURL, change all URLs to example.com - #6937

Closed
sciwhiz12 wants to merge 1 commit into
MinecraftForge:1.16.xfrom
sciwhiz12:1.16_mdk_urls
Closed

sciwhiz12 wants to merge 1 commit into
MinecraftForge:1.16.xfrom
sciwhiz12:1.16_mdk_urls

Conversation

@sciwhiz12

Copy link
Copy Markdown
Contributor

A discussion on Discord which was prompted by a false-report, led to http://myurl.me, the default value for updateJSONURL, being discovered as owned by a third-party and causing false reports about it erroring on a 4xx code, and the http protocol thought as being a vulnerability for hijacking (ex. something MITMs all http connections on the network).

This PR simply does the following changes to the MDK's mods.toml:

  • comments out updateJSONURL, so no unnecessary connections are made; and
  • replaces all URLs present to https://example.com, a known safe example site. (as defined in RFC 2606, §3)

@LexManos

LexManos commented Jul 7, 2020

Copy link
Copy Markdown
Member

HTTP hate over MITM is just ignorant fearmongering.
The myurl.me is MEANT to error. Modders should be reading the damn file and inputting valid URLs. This error in the log is fully intentional to get people to fill in their info.

@LexManos LexManos closed this Jul 7, 2020
@sciwhiz12
sciwhiz12 deleted the 1.16_mdk_urls branch July 7, 2020 18:54
@pau101

pau101 commented Jul 7, 2020 •

Copy link
Copy Markdown
Contributor

The example url errors solely by the fact that the domain is up for sale and not currently serving the expected json response, not because it is under forge's control and designed specifically to provide this result. Moreover, it is not particularly courteous to use a third-party web domain in such a manner, it is typically expected to obtain permission first. The address "https://example.com" is intended to be used freely for this sort of thing.

It is inevitable that developers will release mods without correcting their mod info fully and it should at least in part be forge's responsibility for what this apparent "default" value is.

@cpw

cpw commented Jul 7, 2020

Copy link
Copy Markdown
Contributor

It is inevitable that developers will release mods without correcting their mod info fully and it should at least in part be forge's responsibility for what this apparent "default" value is.

Nonsense. It gets hits because mods are popular so a domain squatter "sees" the name, and moves in. That's what's actually happened.

It is expected that modders populate this with a proper value. We can't be responsible for every error in every mod. That's insanity.

@sciwhiz12

Copy link
Copy Markdown
Contributor Author

Another suggestion, perhaps: change the URL to http://CHANGE.THIS.BEFORE.RELEASE.example.invalid or similar (CHANGE.OR.REMOVE.BEFORE.RELEASE.example.invalid?)

It still provides an error, and RFC 6761 states that all domains within invalid. are special:

... Instead, caching DNS servers SHOULD generate immediate NXDOMAIN responses for all such queries. This is to avoid unnecessary load on the root name servers and other name servers."

This way, no 3rd-party servers are ever contacted, it is guaranteed that this will always error regardless if someone actually buys the URL, and the error is extremely obvious to anyone even glancing at it (UnknownHostException, or a long line in mods.toml with a long URL screaming that they should change it). If they can't read or understand the obvious error, then they have bigger problems.

Error from having the above URL in the mods.toml
[16:35:36] [Forge Version Check/INFO] [ne.mi.fm.VersionChecker/]: [basedefense] Starting version check at http://CHANGE.THIS.BEFORE.RELEASE.example.invalid
[16:35:36] [Forge Version Check/WARN] [ne.mi.fm.VersionChecker/]: Failed to process update information
java.net.UnknownHostException: CHANGE.THIS.BEFORE.RELEASE.example.invalid
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) ~[?:1.8.0_252] {}
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) ~[?:1.8.0_252] {}
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_252] {}
	at java.net.Socket.connect(Socket.java:607) ~[?:1.8.0_252] {}
	at java.net.Socket.connect(Socket.java:556) ~[?:1.8.0_252] {}
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180) ~[?:1.8.0_252] {}
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) ~[?:1.8.0_252] {}
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) ~[?:1.8.0_252] {}
	at sun.net.www.http.HttpClient.(HttpClient.java:242) ~[?:1.8.0_252] {}
	at sun.net.www.http.HttpClient.New(HttpClient.java:339) ~[?:1.8.0_252] {}
	at sun.net.www.http.HttpClient.New(HttpClient.java:357) ~[?:1.8.0_252] {}
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1226) ~[?:1.8.0_252] {}
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162) ~[?:1.8.0_252] {}
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056) ~[?:1.8.0_252] {}
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:990) ~[?:1.8.0_252] {}
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1570) ~[?:1.8.0_252] {}
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) ~[?:1.8.0_252] {}
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) ~[?:1.8.0_252] {}
	at net.minecraftforge.fml.VersionChecker$1.openUrlStream(VersionChecker.java:173) ~[?:?] {re:classloading}
	at net.minecraftforge.fml.VersionChecker$1.process(VersionChecker.java:206) ~[?:?] {re:classloading}
	at java.lang.Iterable.forEach(Iterable.java:75) [?:1.8.0_252] {}
	at net.minecraftforge.fml.VersionChecker$1.run(VersionChecker.java:157) [?:?] {re:classloading}
  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants