Skip to content

Commit a5220a0

Browse files
committed
Remove the RANCID migration page
The RANCID migration page could be used by an unauthentcated user to gain control over the linux user running oxidized-web. Thank you to Jon O'Reilly and Jamie Riden from NetSPI for discovering and reporting this security issue!
1 parent f147fe4 commit a5220a0

File tree

7 files changed

+7
-273
lines changed

7 files changed

+7
-273
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

77
## [Unreleased]
8+
This release fixes a security issue on the RANCID migration page.
9+
A non-authenticated user could gain control over the Linux user running
10+
oxidized-web. The RANCID migration page was already deprecated in version
11+
0.14.0, so it has been completely removed in this new version.
12+
Thank you to Jon O'Reilly and Jamie Riden from NetSPI for discovering and
13+
reporting this security issue!
814

915
### Added
1016

1117
### Changed
1218
- Update datatables.net to 2.2.2 and datatables.net-buttons to 3.2.2 (@robertcheramy)
1319
- remove the RANCID migration page (@robertchreamy)
1420
- dependency on oxidized 0.31 (@robertchreamy)
21+
- Update datatables.net to 2.2.1 and datatables.net-buttons to 3.2.1 (@robertcheramy)
1522

1623
### Fixed
1724
- #302: group name containing a '/' produced a Sinatra error (@robertcheramy)

lib/oxidized/web/mig.rb

Lines changed: 0 additions & 140 deletions
This file was deleted.

lib/oxidized/web/public/scripts/oxidized.js

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
1-
// Add a line for a new file to upload
2-
var add_file_upload = function() {
3-
var rancidDbDiv = $("div[id^='rancidDb']:last");
4-
var num = parseInt(rancidDbDiv.prop("id").match(/\d+/g)) + 1;
5-
rancidDbDiv.clone(true)
6-
.prop("id", "rancidDb" + num)
7-
.insertAfter(rancidDbDiv);
8-
$("input[id^='file']:last")
9-
.prop("id", "file" + num)
10-
.prop("name", "file" + num)
11-
.parents('.input-group')
12-
.find(':text')
13-
.val('');
14-
$("input[id^='group']:last")
15-
.prop("id", "group" + num)
16-
.prop("name", "group" + num);
17-
};
18-
19-
var onFileSelected = function() {
20-
$(document).on('change', '.btn-file :file', function() {
21-
var input = $(this),
22-
numFiles = input.get(0).files ? input.get(0).files.length : 1,
23-
label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
24-
input.trigger('fileSelect', [numFiles, label]);
25-
});
26-
};
27-
281
var convertTime = function() {
292
/* Convert UTC times to local browser times
303
* Requires that the times on the server are UTC
@@ -51,15 +24,6 @@ var convertTime = function() {
5124
$(function() {
5225
onFileSelected();
5326
convertTime();
54-
// Add a row to the migration form
55-
$("#add").click(function() {
56-
add_file_upload();
57-
});
58-
59-
// Updates textbox with filename on fileSelect event
60-
$('.btn-file :file').on('fileSelect', function(e, numFiles, label) {
61-
$(this).parents('.input-group').find(':text').val(label);
62-
});
6327

6428
// Reloads the nodes from a source by calling the /reload.json URI
6529
$('#reload').click(function() {

lib/oxidized/web/public/scripts/script-migration.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

lib/oxidized/web/views/layout.haml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
%a.nav-link{class: request.path_info == '/nodes/stats' ? 'active' : '',
2121
:'aria-current' => request.path_info == '/nodes/stats' ? 'page' : 'false',
2222
href: url_for('/nodes/stats')} Stats
23-
%li.nav-item
24-
%a.nav-link{class: request.path_info == '/migration' ? 'active' : '',
25-
:'aria-current' => request.path_info == '/migration' ? 'page' : 'false',
26-
href: url_for('/migration')} Migration
2723
%form.d-flex{role: 'search',
2824
action: url_for('/nodes/conf_search'),
2925
method: 'post'}

lib/oxidized/web/views/migration.haml

Lines changed: 0 additions & 53 deletions
This file was deleted.

lib/oxidized/web/webapp.rb

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# rubocop:disable Lint/RedundantRequireStatement
77
require 'pp'
88
# rubocop:enable Lint/RedundantRequireStatement
9-
require 'oxidized/web/mig'
109
require 'htmlentities'
1110
require 'charlock_holmes'
1211
module Oxidized
@@ -136,30 +135,6 @@ class WebApp < Sinatra::Base
136135
out :node
137136
end
138137

139-
# redirect to the web page for rancid - oxidized migration
140-
get '/migration' do
141-
out :migration
142-
end
143-
144-
# get the files send
145-
post '/migration' do
146-
number = params[:number].to_i
147-
cloginrc_file = params['cloginrc'][:tempfile]
148-
path_new_file = params['path_new_file']
149-
150-
router_db_files = []
151-
152-
i = 1
153-
while i <= number
154-
router_db_files.push({ file: params["file#{i}"][:tempfile], group: params["group#{i}"] })
155-
i += 1
156-
end
157-
158-
migration = Mig.new(router_db_files, cloginrc_file, path_new_file)
159-
migration.go_rancid_migration
160-
redirect url_for('//nodes')
161-
end
162-
163138
# display the versions of a node
164139
# URL: /node/version[.json]?node_full=<GroupName/NodeName>
165140
get '/node/version.?:format?' do

0 commit comments

Comments
 (0)