Bug 1358099

Summary: novncproxy: directory listing on :6080/include/
Product: Red Hat OpenStack Reporter: VIKRANT <vaggarwa>
Component: python-websockifyAssignee: Solly Ross <sross>
Status: CLOSED ERRATA QA Contact: Prasanth Anbalagan <panbalag>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0 (Liberty)CC: dclarke, mwitt, nlevinki, srevivo
Target Milestone: ---Keywords: Rebase, ZStream
Target Release: 8.0 (Liberty)   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-websockify-0.8.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-14 19:57:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description VIKRANT 2016-07-20 04:04:03 UTC
Description of problem:
novncproxy: directory listing on :6080/include/
It should not give the directory listing.  

Version-Release number of selected component (if applicable):
RHEL OSP 8 

How reproducible:
Everytime.

Steps to Reproduce:
1. Check the port on which novnc proxy is listening.

[root@allinone8 ~(keystone_admin)]# rpm -qa | grep -i webs
python-websockify-0.6.0-2.el7ost.noarch

[root@allinone8 ~(keystone_admin)]# lsof -ni:6080
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nova-novn 1236 nova    4u  IPv4  28837      0t0  TCP *:6080 (LISTEN)

2. Perform curl 

[root@allinone8 ~(keystone_admin)]# curl http://192.168.122.51:6080/include/
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html>
<title>Directory listing for /include/</title>
<body>
<h2>Directory listing for /include/</h2>
<hr>
<ul>
<li><a href="base.css">base.css</a>
<li><a href="base64.js">base64.js</a>
<li><a href="black.css">black.css</a>
<li><a href="blue.css">blue.css</a>
<li><a href="des.js">des.js</a>
<li><a href="display.js">display.js</a>
<li><a href="input.js">input.js</a>
<li><a href="jsunzip.js">jsunzip.js</a>
<li><a href="keyboard.js">keyboard.js</a>
<li><a href="keysym.js">keysym.js</a>
<li><a href="keysymdef.js">keysymdef.js</a>
<li><a href="logo.js">logo.js</a>
<li><a href="Orbitron700.ttf">Orbitron700.ttf</a>
<li><a href="Orbitron700.woff">Orbitron700.woff</a>
<li><a href="playback.js">playback.js</a>
<li><a href="rfb.js">rfb.js</a>
<li><a href="ui.js">ui.js</a>
<li><a href="util.js">util.js</a>
<li><a href="websock.js">websock.js</a>
<li><a href="webutil.js">webutil.js</a>
</ul>
<hr>
</body>
</html>


3.

Actual results:
It's returning the results of directory.

Expected results:
It should not return the results of directories. 

Additional info:

Same issue was present in RHEL OSP 7 in version python-websockify-0.6.0-2.el7ost.noarch but it got fixed in version python-websockify-0.8.0-1.el7.noarch. 

But currently no updated package with fix is available for RHEL OSP 8

Comment 2 Diana Clarke 2016-07-28 19:35:05 UTC
It looks like this issue was fixed in websockify version 0.6.1 (circa May 2015).

    Restore functionaltiy to file_only
    https://github.com/kanaka/websockify/commits/v0.6.1

Nova bumped the global requirements to websockify 0.6.1 in August of 2015, and marked the upstream bug fixed in the 12.0.0 "liberty" milestone (circa October 2015).

    directory listing of the service No-VNC Edit
    https://bugs.launchpad.net/nova/+bug/1447675

Comment 3 melanie witt 2016-09-16 14:37:37 UTC
We have a build of websockify 0.8.0 staged for OSP 8 which should fix this issue.

Comment 5 Prasanth Anbalagan 2016-11-07 14:51:39 UTC
Directory contents are not listed when trying to list the directory.

[root@serverX ~(keystone_admin)]# rpm -qa | grep -i webs
python-websockify-0.8.0-1.el7.noarch
[root@serverX ~(keystone_admin)]# lsof -ni:6080
COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nova-novn 14312 nova    4u  IPv4  27620      0t0  TCP *:6080 (LISTEN)
[root@serverX ~(keystone_admin)]# curl http://127.0.0.1:6080/include/
<head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code 404.
<p>Message: No such file.
<p>Error code explanation: 404 = Nothing matches the given URI.
</body>
[root@serverX ~(keystone_admin)]# 
[root@serverX ~(keystone_admin)]# curl  http://127.0.0.1:6080/include/websock.js
/*
 * Websock: high-performance binary WebSockets
 * Copyright (C) 2012 Joel Martin
 * Licensed under MPL 2.0 (see LICENSE.txt)
 *
 * Websock is similar to the standard WebSocket object but Websock
 * enables communication with raw TCP sockets (i.e. the binary stream)
 * via websockify. This is accomplished by base64 encoding the data
 * stream between Websock and websockify.
 *
 * Websock has built-in receive queue buffering; the message event
 * does not contain actual data but is simply a notification that
 * there is new data available. Several rQ* methods are available to
 * read binary data off of the receive queue.
 */

/*jslint browser: true, bitwise: true */
/*global Util*/


// Load Flash WebSocket emulator if needed

// To force WebSocket emulator even when native WebSocket available
//window.WEB_SOCKET_FORCE_FLASH = true;
.
..
....
        },

        }
    };
})();

Comment 7 errata-xmlrpc 2016-11-14 19:57:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2712.html