Security issue - users can manipulate the URL

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
cmsgenie
New Member
New Member
Posts: 3
Joined: Tue May 13, 2014 8:36 am

Security issue - users can manipulate the URL

Post by cmsgenie »

Hi,
I am using 1.11.10 and pretty URLs.
Given a page named test, it is accessible using its:
  • * Page alias, e.g. /test
    * Page URL, e.g. /testfolder/test
    * Page ID, e.g. /25 (if that is the page id for the test page)
But, the following form also works:
  • * /aaaa/test
    * /aaaa/bbbb/test
and so on.

This is undesirable, because a member of the public could publis a URL to our side along the lines of
/ThisCompanyAllowsMeTo/CreateURLSThatAreOffensive/test

How can we stop this kind of behavior?

This also affects modules like Search and News for instance.
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: Security issue - users can manipulate the URL

Post by paulbaker »

This has been raised before. I don't think there is a way to prevent it except switching off pretty URLs.

You can add this code to your template(s) to add the canonical URL for the page in the HEAD:

Code: Select all

{if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}" />{/if}
Search engines will then know the correct URL for the page.

It's not strictly a security issue. More a URL vanity issue IMHO.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Security issue - users can manipulate the URL

Post by Jo Morg »

paulbaker wrote:It's not strictly a security issue.
Exactly: not a security issue. It can be seen as a "hackish" way of linking from an external site to a page in a CMSMS site.
paulbaker wrote:This has been raised before. I don't think there is a way to prevent it except switching off pretty URLs.
True! Look at this post: http://forum.cmsmadesimple.org/viewtopi ... 8&p=279909
It's a secondary effect of the versatility CMSMS offers, and with canonical URL's properly setup, your SEO ranks wont be affected.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “CMSMS Core”