index.js
JAVASCRIPT
Verdict: BENIGN
Local reference
Suspicious dependency
Inferred
| 1 |
"use strict"; |
|
| 2 |
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
|
| 3 |
if (k2 === undefined) k2 = k; |
|
| 4 |
var desc = Object.getOwnPropertyDescriptor(m, k); |
|
| 26 |
return (mod && mod.__esModule) ? mod : { "default": mod }; |
|
| 27 |
}; |
|
| 28 |
Object.defineProperty(exports, "__esModule", { value: true }); |
|
| 29 |
exports.HttpsProxyAgent = void 0; |
|
| 30 |
const net = __importStar(require("net")); |
|
| 31 |
const tls = __importStar(require("tls")); |
|
| 32 |
const assert_1 = __importDefault(require("assert")); |
|
| 33 |
const debug_1 = __importDefault(require("debug")); |
|
| 34 |
const agent_base_1 = require("agent-base"); |
|
| 35 |
const url_1 = require("url"); |
|
| 36 |
const parse_proxy_response_1 = require("./parse-proxy-response"); |
|
| 37 |
const debug = (0, debug_1.default)('https-proxy-agent'); |
|
| 38 |
const setServernameFromNonIpHost = (options) => { |
|
| 39 |
if (options.servername === undefined && |
|
| 104 |
: { ...this.proxyHeaders }; |
|
| 105 |
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; |
|
| 106 |
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`; |
|
| 107 |
// Inject the `Proxy-Authorization` header if necessary. |
|
| 108 |
if (proxy.username || proxy.password) { |
|
| 109 |
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; |
|
| 110 |
headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`; |
Base64 encoding via toString (JS) |
| 111 |
} |
|
| 112 |
headers.Host = `${host}:${opts.port}`; |
|
| 147 |
// sensitive data). |
|
| 148 |
// |
|
| 149 |
// See: https://hackerone.com/reports/541502 |
|
| 150 |
socket.destroy(); |
|
| 151 |
const fakeSocket = new net.Socket({ writable: false }); |
Node net.Socket.connect method |
| 152 |
fakeSocket.readable = true; |
|
| 153 |
// Need to wait for the "socket" event to re-play the "data" events. |
|
| 179 |
return ret; |
|
| 180 |
} |
|
| 181 |
//# sourceMappingURL=index.js.map |
Code has source map reference |
Objectives
| 147 |
// sensitive data). |
|
| 148 |
// |
|
| 149 |
// See: https://hackerone.com/reports/541502 |
|
| 150 |
socket.destroy(); |
|
| 151 |
const fakeSocket = new net.Socket({ writable: false }); |
|
| 152 |
fakeSocket.readable = true; |
|
| 153 |
// Need to wait for the "socket" event to re-play the "data" events. |
|
| 104 |
: { ...this.proxyHeaders }; |
|
| 105 |
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; |
|
| 106 |
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`; |
|
| 107 |
// Inject the `Proxy-Authorization` header if necessary. |
|
| 108 |
if (proxy.username || proxy.password) { |
|
| 109 |
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; |
|
| 110 |
headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`; |
|
| 111 |
} |
|
| 112 |
headers.Host = `${host}:${opts.port}`; |
|
Micro-behaviors
| 147 |
// sensitive data). |
|
| 148 |
// |
|
| 149 |
// See: https://hackerone.com/reports/541502 |
|
| 150 |
socket.destroy(); |
|
| 151 |
const fakeSocket = new net.Socket({ writable: false }); |
|
| 152 |
fakeSocket.readable = true; |
|
| 153 |
// Need to wait for the "socket" event to re-play the "data" events. |
|
| 104 |
: { ...this.proxyHeaders }; |
|
| 105 |
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; |
|
| 106 |
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`; |
|
| 107 |
// Inject the `Proxy-Authorization` header if necessary. |
|
| 108 |
if (proxy.username || proxy.password) { |
|
| 109 |
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; |
|
| 110 |
headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`; |
|
| 111 |
} |
|
| 112 |
headers.Host = `${host}:${opts.port}`; |
|
| 104 |
: { ...this.proxyHeaders }; |
|
| 105 |
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; |
|
| 106 |
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`; |
|
| 107 |
// Inject the `Proxy-Authorization` header if necessary. |
|
| 108 |
if (proxy.username || proxy.password) { |
|
| 109 |
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; |
|
| 110 |
headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`; |
|
| 111 |
} |
|
| 112 |
headers.Host = `${host}:${opts.port}`; |
|
| 147 |
// sensitive data). |
|
| 148 |
// |
|
| 149 |
// See: https://hackerone.com/reports/541502 |
|
| 150 |
socket.destroy(); |
|
| 151 |
const fakeSocket = new net.Socket({ writable: false }); |
|
| 152 |
fakeSocket.readable = true; |
|
| 153 |
// Need to wait for the "socket" event to re-play the "data" events. |
|
Metadata
| 179 |
return ret; |
|
| 180 |
} |
|
| 181 |
//# sourceMappingURL=index.js.map |
|
Identity
| SHA-256 |
97e49ffdd05dd3fe2eeb7dfaacb55fed52e2c3505d26bc5948ddba603726cd1b |
| Filename |
index.js |
Timeline
| First seen |
27 Jun 2026 19:08 UTC |
| First analyzed |
27 Jun 2026 19:11 UTC |
| Last analyzed |
27 Jun 2026 19:11 UTC |
| Last updated |
27 Jun 2026 19:11 UTC |
Labeling
| Label |
good |
| Label source |
harvest |
| Traits version |
46112 |