@nodesecure/js-x-ray
Version:
JavaScript AST XRay analysis
27 lines • 1.05 kB
TypeScript
import type { ESTree } from "meriyah";
import type { ProbeContext, ProbeMainContext } from "../ProbeRunner.ts";
/**
* @description Detect serialization of process.env which could indicate environment variable exfiltration
* @example
* JSON.stringify(process.env)
* JSON.stringify(process["env"])
* JSON.stringify(process["env"])
* JSON.stringify(process[`env`])
*/
declare function validateJsonStringify(node: ESTree.Node, ctx: ProbeContext): [boolean, any?];
declare function defaultHandler(node: ESTree.Node, ctx: ProbeMainContext): symbol;
declare function processEnvHandler(node: ESTree.Node, ctx: ProbeMainContext): symbol | null;
declare function initialize(ctx: ProbeContext): void;
declare const _default: {
name: string;
validateNode: (typeof validateJsonStringify)[];
initialize: typeof initialize;
main: {
default: typeof defaultHandler;
"process.env": typeof processEnvHandler;
};
breakOnMatch: boolean;
context: {};
};
export default _default;
//# sourceMappingURL=isSerializeEnv.d.ts.map