+4
-1
@@ -232,3 +232,3 @@ import { RawSourceMap, SourceMapGenerator } from 'source-map-js' | ||
| css: { toString(): string } | string, | ||
| opts?: Pick<ProcessOptions, 'document' | 'from' | 'map'> | ||
| opts?: Pick<ProcessOptions, 'document' | 'from' | 'map' | 'unsafeMap'> | ||
| ): RootNode | ||
@@ -358,2 +358,5 @@ } | ||
| * Disable source map file protections. | ||
| * | ||
| * By default source map is limited only for `.map` files | ||
| * in the `from` folder. | ||
| */ | ||
@@ -360,0 +363,0 @@ unsafeMap?: boolean |
+11
-2
| 'use strict' | ||
| let { existsSync, readFileSync } = require('fs') | ||
| let { dirname, join } = require('path') | ||
| let { dirname, isAbsolute, join, relative, sep } = require('path') | ||
| let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') | ||
@@ -88,3 +88,2 @@ | ||
| loadFile(path, cssFile, trusted) { | ||
| /* c8 ignore next 5 */ | ||
| if (!trusted && !this.unsafeMap) { | ||
@@ -94,2 +93,12 @@ if (!/\.map$/i.test(path)) { | ||
| } | ||
| if (cssFile) { | ||
| let relativePath = relative(dirname(cssFile), path) | ||
| if ( | ||
| relativePath === '..' || | ||
| relativePath.startsWith('..' + sep) || | ||
| isAbsolute(relativePath) | ||
| ) { | ||
| return undefined | ||
| } | ||
| } | ||
| } | ||
@@ -96,0 +105,0 @@ this.root = dirname(path) |
+1
-1
@@ -10,3 +10,3 @@ 'use strict' | ||
| constructor(plugins = []) { | ||
| this.version = '8.5.17' | ||
| this.version = '8.5.18' | ||
| this.plugins = this.normalize(plugins) | ||
@@ -13,0 +13,0 @@ } |
+1
-1
| { | ||
| "name": "postcss", | ||
| "version": "8.5.17", | ||
| "version": "8.5.18", | ||
| "description": "Tool for transforming styles with JS plugins", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
214456
0.18%7313
0.16%