sonarjs/weak-ssl
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/weak-ssl": "error",
},
},
];let options = {
secureProtocol: 'TLSv1_method' // Noncompliant: TLS1.0 is insecure
};
let options = {
minVersion: 'TLSv1.1', // Noncompliant: TLS1.1 is insecure
maxVersion: 'TLSv1.2'
};
let options = {
secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_TLSv1
}; // Noncompliant TLS 1.1 (constants.SSL_OP_NO_TLSv1_1) is not disabledlet req = https.request(options, (res) => {
res.on('data', (d) => {
process.stdout.write(d);
});
}); // Noncompliantlet socket = tls.connect(443, "www.example.com", options, () => { }); // Noncompliantlet options = {
secureProtocol: 'TLSv1_2_method'
};
// or
let options = {
secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_TLSv1 | constants.SSL_OP_NO_TLSv1_1
};
// or
let options = {
minVersion: 'TLSv1.2'
};let req = https.request(options, (res) => {
res.on('data', (d) => {
process.stdout.write(d);
});
});let socket = tls.connect(443, "www.example.com", options, () => { });Examples from the ESLint documentation.
sonarjs/weak-ssl
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/weak-ssl": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Web application technologies should not disclose version information
Vi.mock should be declared at module scope
XML parsers should not be vulnerable to XXE attacks
Loop counters should not be assigned within the loop body