News for hackers. Stuff that matters.
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by guptaneil on Thursday August 31, 2017 @10:40AM (#15140623)
Hosting files is a feature. The bug is doing so on the same domain as an official government source. The fix is registering a non-gov domain like fccusercontent.com and hosting files from there. (Also they should probably limit the API to only accept pdf's, txt, and other reasonable file types.)
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by evanb on Thursday August 31, 2017 @11:11AM (#15140849)
Or something like citizens-uploaded-content.gov
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by equalunique on Thursday August 31, 2017 @11:40AM (#15141055)
This is more realistic because I believe the US government is mostly restricted from using the .com TLD. That decision came from:

"Digital Government: Building a 21st Century Platform to Better Serve the American People". United States Federal CIO Council. May 23, 2012.

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by gertef on Thursday August 31, 2017 @05:48PM (#15144255)
The Federal goverment can authorize a contractor to host authorized content: annualcreditreport.com

This is a bad idea, though, as it makes it easy and legal for non-authorized entities to impersonate the authorized ones: freecreditreport.com

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by 0x4a42 on Thursday August 31, 2017 @01:17PM (#15141915)
How PDF is a reasonable file type?
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by SEJeff on Thursday August 31, 2017 @12:20PM (#15141368)
This is what github did with gist and github pages, for similar issues.
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by Alex3917 on Thursday August 31, 2017 @12:44PM (#15141594)
It seems more appropriate just to add a ~ to the url, indicating that it's a user-uploaded file from an otherwise trusted domain. Browsers can then warn users about that however they want.
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by krastanov on Thursday August 31, 2017 @01:44PM (#15142159)
From some quick googling, it seems to me that having a ~ in the url is not a standard, rather it is only a coincidence that most of the time it is used in cases where the content is user uploaded (e.g. the user home directory on a UNIX machine).
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by Alex3917 on Thursday August 31, 2017 @04:38PM (#15143721)
It's not a coincidence, the reason that universities and other content providers follow this pattern is specifically to signal that the company/institution doesn't vouch for whatever is being hosted.
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by jlgaddis on Thursday August 31, 2017 @05:10PM (#15143962)
The reason is because that's how mod_userdir has worked for a couple of decades or so.

It was a way to easily allow unprivileged users to share content from their ~/public_html/ directory.

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by Alex3917 on Thursday August 31, 2017 @05:58PM (#15144311)
Interesting. This makes sense from a technical perspective.

Nevertheless, it's clearly associated with UGC content, and as far as I know there have never been any major sites that have hosted non-UGC content using this scheme. (E.g. there is no history of use for things like Amazon product pages or whatever.)

And in school we were always taught that content coming from user pages on university systems shouldn't be cited as if it were academic content being published or endorsed by the university. I'm sure others were taught the same.

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by p4lindromica on Thursday August 31, 2017 @07:26PM (#15144878)
The reason this matters is the same origin policy, which tilde does not protect you from
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by Alex3917 on Thursday August 31, 2017 @08:00PM (#15145065)
That makes sense. I still think there is good reason to create a standard around this indicating UGC content within a subdomain though. For example:

- Browsers might want to treat it differently for malware scanning purposes.

- Content owners might want to treat it differently when filing automated DMCA complaints.

- Search engines might want to treat it differently for ranking purposes.

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by cyphar on Thursday August 31, 2017 @08:50PM (#15145305)
One of the biggest reasons why GitHub (for example) uses a separate subdomain is so that a persistent XSS exploit on their UGC domain cannot access HTTPOnly cookies or other information from their real domain. Impersonation is a bigger problem for a government, but it's also a security measure against how broken the current security model for things like cookies is.
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by Alex3917 on Thursday August 31, 2017 @10:55PM (#15145765)
I get why subdomains can be useful for preventing XSS and CORS issues, especially for non API-driven sites. The problem is that subdomains are used for all sorts of things, so just because something is on a subdomain doesn't signal that it's UGC content. Even if you hosted each person's content on its own subdomain, it would still be useful to have a standard way to signal that this content wasn't created by the organization who owns the domain.

The benefit of the tilde is that, at least as far as I know, it has never been used for anything other than signaling that something is UGC content. (Even if that was a technological accident and not its original intent.)

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by joombaga on Thursday August 31, 2017 @11:46PM (#15145973)
> it would still be useful to have a standard way to signal that this content wasn't created by the organization who owns the domain.

Do you think the assumption that the content was created by the organization who owns the domain should be default? Wouldn't it be better for the organization to provide a signature for the content it did create?

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by Alex3917 on Friday September 01, 2017 @12:30AM (#15146126)
> Do you think the assumption that the content was created by the organization who owns the domain should be default?

Sure, and I think that is the current assumption. What's missing is a way to specify UGC content that wasn't created by the organization.

> Wouldn't it be better for the organization to provide a signature for the content it did create?

I don't think this would be viable for two reasons:

- It would require people to do the work to opt in, without any obvious incentive for doing so.

- No obvious way to different UGC content from javascript dependencies, fonts, ad trackers, etc.

Whereas there are good use cases for allowing folks to mark content as being UGC. For example, let's say the game Draw Something wanted to let users upload their creations. So no security issues, since images are created through their own app, but they don't necessarily want everyone thinking that they're spending all day creating and uploading millions of dick drawings either.

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by p4lindromica on Friday September 01, 2017 @12:53AM (#15146205)
I have no idea what problem you think you are solving. Could you clearly state your goals and why you think they are broadly applicable?
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by Alex3917 on Friday September 01, 2017 @08:31AM (#15147792)
So the original question was how to signal that files uploaded by users to the FCC were not created by the FCC. Some people suggested entirely different domains, but that's hacky and doesn't really solve the issue. And maybe the content should be hosted on a subdomain for security reasons, but that still doesn't solve the issue of signaling that it wasn't created by the FCC.

I suggested just adding a ~ to the domain name, because when you see a domain name like this:

http://www.cs.columbia.edu/~allen/

It's universally recognized that the content on that page was not created by columbia.edu or cs.columbia.edu in an official capacity.

Other people said we can't do this because it's not an official standard, so I said let's just make it a standard. Which I think is good because it keeps an important piece of Internet culture alive by codifying it, which would let people rely on it when designing new systems. And ultimately it should work because there is no history of this URL pattern being used for non-UGC content.

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by p4lindromica on Friday September 01, 2017 @08:15PM (#15153344)
it amazes me that you consider this post to be an accurate depiction of the way the world is.

it appears your only goal is to be right.

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by cyphar on Friday September 01, 2017 @01:29AM (#15146352)
Ugh, typo (and I can't edit it anymore). I meant "separate domain". Subdomains actually don't protect against cookie attacks.
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by kevin_thibedeau on Thursday August 31, 2017 @05:08PM (#15143932)
They use it because universities traditionally exposed per-user web pages through the Unix shortcut path to their home account directory. The tilde has no other significance and doesn't make much sense outside of a Unix system.
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by dawnerd on Thursday August 31, 2017 @03:51PM (#15143317)
Normal people not familiar with tech wont know what that means. They'll see fcc.gov and think its safe.
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by inetknght on Thursday August 31, 2017 @01:15PM (#15141898)
Is that an actual standard or... just common practice?
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by Alex3917 on Thursday August 31, 2017 @01:24PM (#15141971)
It's a unix standard, or at least more than just a design pattern. You know how in any unix shell, typing cd ~ takes you to your home directory? This is actually a shortcut for typing cd ~yourusername. So having xyz.tld/~username/... in a url path means that the file is hosted in userland, since ~username is the first part of the filepath hosted behind that URL.

Websites have been using this pattern for 25+ years, so it's pretty universal by now.

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by nucleardog on Thursday August 31, 2017 @06:46PM (#15144625)
It's not even a standard. At best you could call it a convention. And a much more narrowly defined one than you seem to think.

The `~` or `~username` is expanded by your shell (but not necessarily all shells) and has nothing to do with the operating system. If you pass a filename like `~myusername/test.txt` to any unix's open() syscall, it's going to either fail or open a file in a directory literally called `~myusername`. This means anywhere you're passing a filename into a program that isn't your shell does not generally support that syntax.

A narrowly defined, poorly recognized convention is not a great thing to rely on for security purposes.

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by Alex3917 on Thursday August 31, 2017 @07:21PM (#15144849)
Fair enough. What's the process for submitting it as a proposed standard? I'll write it up.
Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by inetknght on Friday September 01, 2017 @08:20AM (#15147719)
It depends on where you want to make the proposal. I'd make a guess with the POSIX standard. At that point, I think you'd submit a proposal somewhere around http://www3.opengroup.org/content/posix®

Also, that ® at the end of posix is part of the URL, you will unfortunately get a 404 if you don't copy-paste it right. You might be better to search for "site:opengroup.org posix"

Good luck, man

Re:The FCC.gov Website Lets You Upload Malware Using Its Own... by gertef on Thursday August 31, 2017 @05:48PM (#15144260)
It's not a security standard.