https: distinguish PFX object-array agent keys

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs-private/node-private/pull/930
Refs: https://hackerone.com/reports/3816840
CVE-ID: CVE-2026-56850
This commit is contained in:
RafaelGSS committed 2026-07-27 19:51:49 -03:00
1 parent a77c7f7354
commit fcbdbe47ea
3 files changed
+119 -1

No files matched your search

+44
View File
@@ -6,6 +6,7 @@ if (!common.hasCrypto)
const assert = require('assert');
const https = require('https');
const fixtures = require('../common/fixtures');
const agent = new https.Agent();
@@ -52,3 +53,46 @@ assert.strictEqual(
'::secureProtocol:c,r,l:false:ecdhCurve:dhparam:0:sessionIdContext:' +
'"sigalgs":privateKeyIdentifier:privateKeyEngine'
);
{
const baseOptions = {
host: '0.0.0.0',
port: 443,
};
const agent1 = fixtures.readKey('agent1.pfx');
const agent6 = fixtures.readKey('agent6.pfx');
assert.notStrictEqual(
agent.getName({
...baseOptions,
pfx: [{ buf: agent1, passphrase: 'sample' }],
}),
agent.getName({
...baseOptions,
pfx: [{ buf: agent6, passphrase: 'sample' }],
})
);
assert.notStrictEqual(
agent.getName({
...baseOptions,
pfx: [{ buf: agent1, passphrase: 'sample' }],
}),
agent.getName({
...baseOptions,
pfx: [{ buf: agent1, passphrase: 'different' }],
})
);
assert.notStrictEqual(
agent.getName({
...baseOptions,
pfx: [{ __proto__: { buf: agent1, passphrase: 'sample' } }],
}),
agent.getName({
...baseOptions,
pfx: [{ __proto__: { buf: agent6, passphrase: 'sample' } }],
})
);
}