Skip to content

Security Fix for Resources Downloaded over Insecure Protocol - huntr.dev #2

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions install.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"use strict";

var fs = require('fs');
var http = require('http');
var https = require('https');
var path = require('path');
var url = require('url');
var util = require('util');
var AdmZip = require('adm-zip');

// TODO: use http://selenium-release.storage.googleapis.com/index.html to find latest version number
var jarURL = 'http://selenium-release.storage.googleapis.com/2.44/selenium-server-standalone-2.44.0.jar';
// TODO: use https://selenium-release.storage.googleapis.com/index.html to find latest version number
var jarURL = 'https://selenium-release.storage.googleapis.com/2.44/selenium-server-standalone-2.44.0.jar';

// TODO: use contents of http://chromedriver.storage.googleapis.com/LATEST_RELEASE to determine version to download
var chromeDriverURL = 'http://chromedriver.storage.googleapis.com/2.14/chromedriver_';
// TODO: use contents of https://chromedriver.storage.googleapis.com/LATEST_RELEASE to determine version to download
var chromeDriverURL = 'https://chromedriver.storage.googleapis.com/2.14/chromedriver_';

if (process.platform === 'linux' && process.arch === 'x64') {
chromeDriverURL += 'linux64.zip';
Expand Down Expand Up @@ -84,7 +84,7 @@ function downloadFile(fileURL, callback) {
var writePath = filePath + '-download-' + Date.now();
var outFile = fs.openSync(writePath, 'w');

var client = http.get(requestOptions, function(response) {
var client = https.get(requestOptions, function(response) {
var status = response.statusCode;

console.log('Receiving...');
Expand All @@ -109,7 +109,7 @@ function downloadFile(fileURL, callback) {
} else {
client.abort();
console.error('Error requesting archive');
callback(new Error('Error with http request: ' + util.inspect(response.headers)));
callback(new Error('Error with https request: ' + util.inspect(response.headers)));
}

});
Expand Down