Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Secure Flag for sysauth Cookie #33

Open
areynold opened this issue Sep 11, 2013 · 5 comments
Open

Missing Secure Flag for sysauth Cookie #33

areynold opened this issue Sep 11, 2013 · 5 comments
Assignees
Labels

Comments

@areynold
Copy link
Collaborator

FINDING ID: iSEC-COMMO13-5

TARGETS: The lack of a Secure flag on the sysauth administrative session cookie.

DESCRIPTION: The Secure flag, when set by the web application for modern browsers, indicates the session cookie should never be sent via a plaintext HTTP connection. This can offer defense in depth against network attacks when the application or administrative portions of the Commotion router uses HTTPS.

EXPLOIT SCENARIO: An attacker may be able to cause the sysauth cookie to be leaked via a plaintext HTTP request. In one example, an attacker could create a plaintext HTTP link to the Commotion router as a local application icon. If an administrator is authenticated to the site over SSL and visits the application list, the browser will issue the plaintext, non-SSL request and automatically include the admin's current session token. A network attacker may be able to capture this value via network sniffing and perform subsequent actions on the administrator's behalf.

SHORT TERM SOLUTION: Use a documented method within LuCI to set the secure flag if it exists or apply the flag when setting the sysauth cookie via luci.http.header.

LONG TERM SOLUTION: Ensure the default administrative interface uses HTTPS via TLS and does not accept plaintext connections. Review the Commotion web applications and attack surface for standard web application best practices. Consider implementing a regression test to ensure this issue does not resurface in future releases once fixed.

@areynold
Copy link
Collaborator Author

Sysauth cookie seems to be built in dispatcher.lua, line 385. Untested, but seems to be a likely starting point.

Would prefer to submit upstream to luci, but this may need to be a commotion-only fix since openwrt doesn't use https by default.

Can also be set at the theme level by adding <httpCookies requireSSL="true" /> to page header. See commotion-openwrt-theme.

@ghost ghost assigned areynold Sep 25, 2013
@areynold
Copy link
Collaborator Author

dispatcher.lua code is duplicated in luci-commotion-linux's apps_controller.lua. Pull request opened.

@areynold
Copy link
Collaborator Author

Fixed in luci-commotion 183c11ceba330407a4db7531fb86bf3a89126d7e

@areynold
Copy link
Collaborator Author

areynold commented Nov 1, 2013

This issue was created before the correct repo was identified, and was assigned to commotion-openwrt as a placeholder.

This issue has been addressed in commotion-openwrt by way of opentechinstitute/luci-commotion#28.

Because luci-commotion-linux is a fork of luci, the same issue exists in that code, and is fixed in opentechinstitute/luci-commotion-linux#1.

I am closing this issue and reopening it in luci-commotion as a request to submit a patch to luci. The patch is unlikely to be accepted since openwrt does not run ssl by default, but it's worth trying.

@areynold
Copy link
Collaborator Author

There's a regression in the Commotion 1.1 release. It looks like the luci core libs are being compiled instead of installed as full source, so the patch to dispatcher.lua is being rejected.

Short term fix would be to build the luci core libs as source and check that the patch still applies cleanly.

Long term fix would be to submit an upstream patch

@areynold areynold reopened this Dec 10, 2014
@jheretic jheretic removed this from the 10-2013 milestone Jan 8, 2015
@areynold areynold removed this from the 10-2013 milestone Jan 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants