Language: TypeScript
Label: vulnerable
CWE: CWE-200 \u2014 Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.

Code:
export async function detectVariablesAndBuildNgsscJson(
  options: NgsscBuildSchema,
  browserOptions: BrowserBuilderOptions,
  context: BuilderContext,
  multiple: boolean = false
) {
  const ngsscContext = await detectVariables(context);
  const outputPath = join(context.workspaceRoot, browserOptions.outputPath);
  const ngssc = buildNgssc(ngsscContext, options, browserOptions, multiple);
  await writeFileAsync(join(outputPath, 'ngssc.json'), JSON.stringify(ngssc, null, 2), 'utf8');
}