From f26f984fa041923c834b48c70a7f4b8412941cd4 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 10 May 2025 11:38:06 +0200 Subject: [PATCH] Improve validation in the `Catalog.prototype.openAction` getter When the /OpenAction data is an Array we're currently using it as-is which could theoretically cause problems in corrupt PDF documents, hence we ensure that a "raw" destination is actually valid. (This change is covered by existing unit-tests.) *Note:* In the Dictionary case we're using the `Catalog.parseDestDictionary` method, which already handles all of the necessary validation. --- src/core/catalog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/catalog.js b/src/core/catalog.js index 46279ae8f..4f12a5d1f 100644 --- a/src/core/catalog.js +++ b/src/core/catalog.js @@ -1029,7 +1029,7 @@ class Catalog { } else if (resultObj.action) { openAction.action = resultObj.action; } - } else if (Array.isArray(obj)) { + } else if (isValidExplicitDest(obj)) { openAction.dest = obj; } return shadow(