Skip to content

Commit d4b062e

Browse files
alexey1312claude
andcommitted
fix: allow HTTPS in PKL resource allowlist for package resolution
The security fix in 56ad2b1 removed https: from both allowedModules and allowedResources. However, package: URI resolution internally downloads archives via HTTPS, so removing it from allowedResources broke all configs using published PKL packages (package://github.com/...). Restore https: in allowedResources only — module imports still block https: to prevent executing remote code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 539e657 commit d4b062e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Sources/ExFigConfig/PKL/PKLEvaluator.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ public enum PKLEvaluator {
2323
"pkl:", "repl:", "file:", "modulepath:", "package:", "projectpackage:",
2424
]
2525

26-
/// Allowed resource schemes (no http/https to prevent network reads).
26+
/// Allowed resource schemes.
27+
/// Includes https: because package: resolution requires downloading archives via HTTPS.
28+
/// Module imports (allowedModules) still block https: to prevent executing remote code.
2729
private static let allowedResources = [
28-
"file:", "env:", "prop:", "modulepath:", "package:", "projectpackage:",
30+
"file:", "env:", "prop:", "modulepath:", "package:", "projectpackage:", "https:",
2931
]
3032

3133
/// Evaluates a PKL configuration file and returns the typed ExFig module.

0 commit comments

Comments
 (0)