From eebf341822ea5b4a2c812d86185b7aab6a8e2e18 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Thu, 15 Aug 2024 21:03:11 -0400 Subject: [PATCH] [Fleet] Fix loading assets manifest (#190650) --- x-pack/plugins/fleet/server/services/epm/packages/get.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/fleet/server/services/epm/packages/get.ts b/x-pack/plugins/fleet/server/services/epm/packages/get.ts index b3f0d28438d54..0e5f5be89cab3 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/get.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/get.ts @@ -5,7 +5,7 @@ * 2.0. */ -import * as yaml from 'js-yaml'; +import { safeLoad } from 'js-yaml'; import pMap from 'p-map'; import type { SavedObjectsClientContract, SavedObjectsFindOptions } from '@kbn/core/server'; import semverGte from 'semver/functions/gte'; @@ -360,7 +360,7 @@ export async function getInstalledPackageManifests( const parsedManifests = result.saved_objects.reduce>( (acc, asset) => { - acc.set(asset.attributes.asset_path, yaml.load(asset.attributes.data_utf8)); + acc.set(asset.attributes.asset_path, safeLoad(asset.attributes.data_utf8)); return acc; }, new Map()