How or Where to Set HttpOnly flag for Cookies : Vulnerability found in Security Audit

Discussion regarding Joomla! 3.x security issues.

Moderators: mandville, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant / FPA - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
mahimamm
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Fri Jul 08, 2016 7:40 am

How or Where to Set HttpOnly flag for Cookies : Vulnerability found in Security Audit

Post by mahimamm » Fri Jul 08, 2016 2:51 pm

Hi All,

I am new to the world of Joomla , so I am not sure if this is a basic question or if there are threads already with good solutions for this.... If so please help me without links without judgements as I was not able to find anything sufficient....

Recently I developed a Joomla website, in the Security one of the issues they pointed out was that "Cookie without HttpOnly flag set", I tried my best to pinpoint the area where I can set this flag, I am using Joomla 3x in the latest version.

I see that in my configurations httponly is set to "On" locally and set to "Off" globally and again from some of the threads I was able to understand that I need to make some changes in the session file, but not very clear of exactly what to do, kindly throw some light....

Thanks in advance.

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4025
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: How or Where to Set HttpOnly flag for Cookies : Vulnerability found in Security Audit

Post by itoctopus » Sat Jul 09, 2016 1:49 pm

Have you tried adding the following to a local (e.g. under the directory containing the Joomla website) php.ini or .user.ini file?

Code: Select all

session.cookie_httponly = 1
session.use_only_cookies = 1
In other words, create a php.ini file or a .user.ini file at the same level of the configuration.php file, and add the above code to it. The above should take effect without restarting Apache.

The problem is that if you do this, then JavaScript will not be able to access the cookies directly and it might be that Joomla or a non-core extension that you're using relies on that - I am not sure and I hope someone from the Joomla core team clarifies that. Personally I haven't tested it so I'm not sure it works. Nevertheless, it's worth a try - but, if it works, makes sure that you test your website thoroughly afterwards.

If I may ask, which vulnerability scanner are you using?
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

mahimamm
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Fri Jul 08, 2016 7:40 am

Re: How or Where to Set HttpOnly flag for Cookies : Vulnerability found in Security Audit

Post by mahimamm » Mon Jul 11, 2016 10:21 am

Thanks a lot for the reply :-)

Is there any other sources where I can read about the solution you have suggested and its effects?

It was an OWASP Top 10 Vulnerabilities based scan and I believe the tools were (Core impact professional R 1.32015
Acunetix 10.5 Web Vulnerability Scanner, HP Web Inspect 16.10)

mahimamm
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Fri Jul 08, 2016 7:40 am

Re: How or Where to Set HttpOnly flag for Cookies : Vulnerability found in Security Audit

Post by mahimamm » Fri Sep 30, 2016 11:07 am

Hi itoctopus,

Thanks a lot for the solution. It worked :-).

Updating in case it might help anyone :-).

Thanks a lot.

Mahima M M


Locked

Return to “Security in Joomla! 3.x”