Sensitive Cookie in HTTPS Session Without 'Secure' Attribute in khodakhah/nodcms


Reported on

Sep 26th 2021

Implement both Secure flag and httponly flag in the application.

Proof of Concept

The secure flag is an option that can be set by the application server when sending a new cookie to the user within an HTTP Response. 
The purpose of the secure flag is to prevent cookies from being observed by unauthorized parties due to the transmission of a the cookie in clear text. To accomplish this goal, browsers which support the secure flag will only send cookies with the secure flag when the request is going to a HTTPS page. Said in another way, the browser will not send a cookie with the secure flag set over an unencrypted HTTP request. By setting the secure flag, the browser will prevent the transmission of a cookie over an unencrypted channel.

PoC Request

GET /en/login HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Te: trailers
Connection: close


HTTP/2 200 OK
Date: Sun, 26 Sep 2021 21:29:22 GMT
Server: Apache
X-Powered-By: PHP/7.2.34
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Cache-Control: no-store, max-age=0, no-cache
Set-Cookie: ci_session=483e0d04fcc809c07b21d95e3240499154eadafb; expires=Sun, 26-Sep-2021 23:29:22 GMT; Max-Age=7200; path=/; HttpOnly
Strict-Transport-Security: max-age=63072000; includeSubDomains
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Vary: Accept-Encoding
Content-Length: 7396
Content-Type: text/html; charset=UTF-8

if os.environ.get('SECURE_PROXY_SSL_HEADER'):

We have contacted a member of the khodakhah/nodcms team and are waiting to hear back a year ago
khodakhah validated this vulnerability a year ago
@0xAmal has been awarded the disclosure bounty
The fix bounty is now up for grabs
khodakhah confirmed that a fix has been merged on ab89b0 a year ago
The fix bounty has been dropped
to join this conversation