/** * Copyright (c) 2025 Ofri Peretz * Licensed under the MIT License. Use of this source code is governed by the * MIT license that can be found in the LICENSE file. */ /** * @fileoverview Disallow `new Buffer()` and `Buffer()` constructor (deprecated since Node 10). * * The `Buffer` constructor and the `Buffer()` factory call return uninitialized * memory when given a number argument — which has caused real vulnerabilities * including CVE-2018-7166 (uninitialized memory disclosure in randomFillSync * fallback). The constructor is deprecated in Node 10+ and emits a runtime * deprecation warning. Use `Buffer.alloc(size)`, `Buffer.allocUnsafe(size)`, * `Buffer.from(value)`, or `Buffer.concat()` instead. * * @see https://nodejs.org/api/buffer.html#bufnew-buffersize * @see https://nvd.nist.gov/vuln/detail/CVE-2018-7166 * @see https://cwe.mitre.org/data/definitions/676.html */ import type { TSESLint } from '@interlace/eslint-devkit'; type MessageIds = 'deprecatedBufferConstructor' | 'deprecatedBufferCall'; export declare const noDeprecatedBuffer: TSESLint.RuleModule; export {};