sonarjs/encryption-secure-mode
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/encryption-secure-mode": "error",
},
},
];Encryption algorithms should be used with secure mode and padding scheme
crypto.createCipheriv("AES-128-CBC", key, iv); // Noncompliant: CBC with PKCS5/7 (set by default) is vulnerable to oracle padding attacks
crypto.createCipheriv("AES-128-ECB", key, ""); // Noncompliant: ECB doesn't provide serious message confidentialitycrypto.createCipheriv("AES-256-GCM", key, iv);Examples from the ESLint documentation.
sonarjs/encryption-secure-mode
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/encryption-secure-mode": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Repeated patterns in regular expressions should not match the empty string
Replacement strings should reference existing regular expression groups
Templates should not be constructed dynamically
Character classes in regular expressions should not contain the same character twice
File permissions should not be set to world-accessible values