Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

security: Dangerous baseurls in themes #171

Closed
MarkDBlackwell opened this issue Oct 16, 2016 · 7 comments
Closed

security: Dangerous baseurls in themes #171

MarkDBlackwell opened this issue Oct 16, 2016 · 7 comments

Comments

@MarkDBlackwell
Copy link
Contributor

MarkDBlackwell commented Oct 16, 2016

A lot of themes have baseurl = "replace-this-with-your-hugo-site.com" in their default config.toml—see [many] examples in the wild.

This URL may be clicked unknowingly by a new user (I did, LOL) and it's very suspicious—it executes scripts redirecting to pages my adblocker dislikes, pops up notices about an infected computer, plays beeping sounds, etc.

An enterprising scammer has registered replace-this-with-your-hugo-site.com (don't bother trying it—popups, beeping, probably exploits), which I accidentally discovered after deploying a misconfigured website, and leading some customers to this very problematic place.

A thorough search of Hugo's theme collection revealed some bad baseurls (from the point of view of security); see Hugo issues here and here.

I assume the best place for us to edit these themes is directly in this repository. Is this assumption correct?

Following are (all of) the bad ones (converted to lower case), along with some good ones:

Good:

Bad:

digitalcraftsman added a commit to digitalcraftsman/hugo-strata-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-steam-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-agency-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-type-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-creative-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-freelancer-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-artists-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-material-docs that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-icarus-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-cactus-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-alabaster-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-minimalist-theme that referenced this issue Oct 16, 2016
digitalcraftsman added a commit to digitalcraftsman/hugo-hikari-theme that referenced this issue Oct 16, 2016
@digitalcraftsman
Copy link
Member

Now, I'm using https://example.org in the example config files of all my themes, namely:

  • Strata
  • Steam
  • Agency
  • Type
  • Creative
  • Freelancer
  • Artists
  • material-docs
  • icarus
  • cactus
  • alabaster
  • minimalist
  • hikari

christianmendoza referenced this issue in christianmendoza/hugo-smpl-theme Oct 16, 2016
aerohub added a commit to aerohub/hugrid that referenced this issue Oct 16, 2016
aerohub added a commit to aerohub/hugo-faq-theme that referenced this issue Oct 16, 2016
aerohub added a commit to aerohub/hugo-orbit-theme that referenced this issue Oct 16, 2016
aerohub added a commit to aerohub/hugo-identity-theme that referenced this issue Oct 16, 2016
kaapiandcode added a commit to kaapiandcode/hugo-goa that referenced this issue Oct 17, 2016
alanorth added a commit to alanorth/hugo-theme-bootstrap4-blog that referenced this issue Oct 19, 2016
Apparently a scammer has registered this other domain and has some
malware, ads, etc on it. There is a GitHub issue tracking this and
recommends changing the example baseURL to something safer.

See: gohugoio/hugoThemes#171
@digitalcraftsman
Copy link
Member

During the last days I began to open issues to inform theme owners about this (potential) form of abuse. At the same time I updated your list @MarkDBlackwell and removed themes that switched to a save base url.

@digitalcraftsman
Copy link
Member

digitalcraftsman commented Nov 5, 2016

Some of the urls will not work even if somebody would like to abuse them:

@MarkDBlackwell
Copy link
Contributor Author

MarkDBlackwell commented Nov 8, 2016

http://your-site-here and http://your_website_url aren't valid URLs

Regarding DNS names which include hyphens or underscores ("-" or "_"):

  1. Both hyphens and underscores are allowed in DNS names;
  2. Underscores are illegal in host names; and
  3. Some software might "helpfully" convert underscores within DNS names into hyphens (see below); some users might similarly "correct" them.

Regarding DNS names which lack top-level domains (".com", etc.): various key combinations reportedly cause certain browsers (IE and Safari) sometimes to append ".com".

Some web browsers (if appropriately configured) sometimes append ".com" automatically to DNS names. For example, in:

  1. Mozilla SeaMonkey, under Preferences-Browser-Location Bar-Unknown Locations:
    1. "Add ... '.com' to the location if a web page is not found"; and
  2. Google Chrome, under Settings-Privacy (perhaps):
    1. "Use a prediction service to help complete ... URLs typed in the address bar";
    2. "Use a web service to help resolve navigation errors"; or
    3. "Use a web service to help resolve spelling errors".

Because of the vagueness of our understanding of the above software, IMO we should err on the side of safety.

tl;dr
Some users' or organizations' browsers might automatically append ".com" to DNS names which lack top-level domains.

After appending ".com" (in all the browsers I checked), http://your-site-here currently rewrites to http://www.your-site-here.com/responsive/wordpress/.

Therefore, IMO we should discourage http://your-site-here and http://your_website_url strongly, as well.

Ref.:
Underscores in DNS – SourceForge
DNS domain name syntax examples – Stack Overflow
".com" auto-add – Google (web search)

@pacollins
Copy link

Since this was never closed, wouldn't it make sense to just make this a requirement in the README.md like screenshots?

Also, hugo-future-imperfect still uses http://hugo.spf13.com/ as the base url - should we change that then?

@digitalcraftsman
Copy link
Member

Since this was never closed, wouldn't it make sense to just make this a requirement in the README.md like screenshots?

That's a good idea. I'll update the guide in the README accordingly.

Also, hugo-future-imperfect still uses http://hugo.spf13.com as the base url - should we change that then?

Are you just talking about the future-imperfect theme?

@pacollins
Copy link

Yeah, its just our theme that I know of (maybe it was part if the default config?).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants