Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

aws-secrets-manager-core

Latest version: v1.0.2

Overview

Last scanned
30 Nov 2026
Published
30 Nov 2026
npm package Publisher: alec-js
2 Stars
0 Forks
4 Versions
Shell Repo language

Scan summary

aws-secrets-manager-core was last scanned on 30 Nov 2026 at version 1.0.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 4 versions, all published on 30 Nov 2026.
  • Findings: No rules fired in version 1.0.2.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.0.2 LATEST 30 Nov 2026 No rules fired
1.0.1 30 Nov 2026 No rules fired
1.0.0 30 Nov 2026 No rules fired
0.0.0-stage 30 Nov 2026 Not shown

No rules fired in 1.0.2

Findings

Findings for v1.0.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.0.2; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Handle AWS Secrets easily in any Node process

aws-secrets-manager-core loads an AWS Secrets Manager secret into a Node process: a test runner, a setup file or a script. It is the engine of cypress-aws-secrets-manager, mocha-aws-secrets-manager and playwright-aws-secrets-manager, and it ships their login scripts.

Which package do you need?

You use Install What you get
Cypress cypress-aws-secrets-manager The secret in config.env, and the updateSecret task.
Mocha mocha-aws-secrets-manager One line in .mocharc.js loads the secret before any test file.
Playwright playwright-aws-secrets-manager One import in playwright.config loads the secret, and a secrets fixture.
Another runner, a script or a tool aws-secrets-manager-core The functions of this README.

Each wrapper installs the core for you. Install the core yourself only to use it directly.

Table of Contents

  • How it works
  • Installation
  • Quick start
  • Configuration
    • Options
    • Where the options come from
    • Login strategies
    • Credentials file
  • Log in to AWS
    • How long a login lasts
    • Login scripts
  • Update a secret
  • Local copy
  • Put the secret in process.env
  • API reference
  • Write a wrapper for another runner
  • What you see
  • Security notes

How it works

  1. You log in to AWS once a day, for example with aws sso login --profile my-sso-profile. The AWS CLI keeps the session on your machine, and every process uses it.
  2. Your process calls the core before it needs a secret. The core reads the latest version of the secret from AWS Secrets Manager, in one call.
  3. The secret goes into memory or into process.env. No file holds it, unless you ask for a local copy. The logs print the key names, never a value.

Installation

npm install --save-dev aws-secrets-manager-core

You need:

  • Node 22 or later.
  • AWS credentials: an AWS SSO profile, which aws configure sso of the AWS CLI v2 creates, or one of the other login strategies.
  • A secret of the "key/value" type: a JSON object of key/value pairs. The core refuses a plaintext or binary secret, and never prints its value.

Quick start

1. Describe the secret. Create aws-secrets.config.js at the root of your project:

// aws-secrets.config.js
module.exports = {
  secretName: 'my-team/e2e', // the name or the full ARN
  region: 'eu-west-1',
  profile: 'my-sso-profile'
}

2. Load it before the code that reads it. The synchronous form waits for the secret, so the next line can read it:

// load-secrets.js: require it before everything else
const core = require('aws-secrets-manager-core')

const reply = core.loadSync({ baseDir: __dirname })
if (!reply.reused) core.publishToEnv(reply.secrets, { source: reply.options })

The asynchronous form fits a global setup, or any async function:

// global-setup.js
const core = require('aws-secrets-manager-core')

module.exports = async () => {
  const options = await core.resolveOptions({ baseDir: __dirname })
  const secrets = await core.loadSecrets(options)
  core.publishToEnv(secrets, { source: options })
}

In a package with "type": "module", a .js file is an ES module, which has no require and no module.exports. There, name these files load-secrets.cjs and global-setup.cjs.

3. Log in, then run.

aws sso login --profile my-sso-profile
node --require ./load-secrets.js my-script.js

process.env.MY_KEY now holds the value of the key MY_KEY. A child process inherits the values, and loadSync in it reuses them: it makes no second AWS call.

Configuration

Options
Option Required Default Meaning
secretName Yes The secret name, or its full ARN.
region Yes The AWS region of the secret.
strategy No multi How to get AWS credentials. See Login strategies.
profile No The AWS SSO profile of the profile strategy.
pathToCredentials No The file of the credentials strategy. See Credentials file.
kmsKeyId No The KMS key that updateSecret sends with the new value. Needed for a secret of another AWS account.
localDir No The folder of the local copy. See Local copy.
baseDir No process.cwd() The folder that relative paths start from, and where the search for the configuration file starts.
silent No false Hides the progress lines. The status line, the warnings and the errors still print.
logger No stderr An object with info, warn and error, and optionally log. Without it, every line goes to stderr, so stdout carries only the output of your program, such as a JSON report.

override and allowUnsafeKeys are options of publishToEnv. The Mocha and Playwright wrappers read them from the same configuration file.

Where the options come from

resolveOptions and loadSync read three sources. A later source wins over an earlier one:

  1. The configuration file. The core looks for aws-secrets.config.js, aws-secrets.config.cjs, aws-secrets.config.mjs and aws-secrets.config.json, in this order. It looks in baseDir, then in each parent folder up to the root of the repository, the folder with .git. Outside a repository, it stops at the nearest folder with package.json, else it reads baseDir only, so a file above your project never runs. The nearest folder wins.
  2. The options in your code, for example loadSync({ baseDir: __dirname, silent: true }).
  3. The environment variables, so CI can change a value on the command line:
Variable Option
AWS_SECRETS_NAME secretName
AWS_SECRETS_REGION region
AWS_SECRETS_PROFILE profile
AWS_SSO_STRATEGY strategy
AWS_SECRETS_LOCAL_DIR localDir
ENV_LOG_MODE=silent silent: true

About the configuration file:

  • A .js, .cjs or .mjs file exports the options, or a function, sync or async, that returns them. A .js file in a package with "type": "module" can use export default.
  • A relative localDir or pathToCredentials starts from the folder of the file.
  • A missing secretName or region, or an unknown strategy, stops with an error that names the key and where to set it. A blank string counts as missing.
  • An option of the wrong type stops in the same way, such as "silent" must be true or false, not a string. The paths, names and strategy take a string, silent and override take true or false, and allowUnsafeKeys takes a list of names.
"secretName" is missing. Set it in one of: aws-secrets.config.js, aws-secrets.config.cjs, aws-secrets.config.mjs, aws-secrets.config.json in the base folder or a parent folder; the options passed to loadSecrets(); the environment variable AWS_SECRETS_NAME.

loadSecrets and updateSecret take the options as you give them: they read no file and no variable. Call resolveOptions first, as the quick start does.

Login strategies
Strategy Where the credentials come from
profile The AWS SSO profile in profile.
default The AWS SSO profile named default.
unset The default credential chain of the AWS SDK: the profile in AWS_PROFILE when it is set, else the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN variables, then the shared AWS files, then a container or instance role. It reads every profile type. Use it on CI.
credentials The file in pathToCredentials.
multi (default) Tries profile, default, unset, then credentials, and stops at the first that works. When all fail, the error gives the reason of each one.
  • profile and default read AWS SSO profiles only. For a profile with keys, a role or a credential_process, use unset and set AWS_PROFILE to the profile name.
  • multi moves on after any error, also when the login works and the secret does not exist. A later attempt can then read the secret with other credentials. When no attempt gets the secret and a login worked, the error says so: it names the strategy, the secret, the region and the AWS error, such as ResourceNotFoundException.
  • With unset, AWS_PROFILE wins over the key variables: the AWS SDK for JavaScript skips the keys when a profile is set.
Credentials file

The credentials strategy reads a JSON or JavaScript file:

{
  "accessKeyId": "AKIA...",
  "secretAccessKey": "...",
  "sessionToken": "..."
}
  • sessionToken is needed for temporary credentials only. A long-term IAM user key has none.
  • A .js or .cjs file exports the object with module.exports, an .mjs file with export default. A path without extension finds what require() finds: a .js or .json file, or the index of a folder.
  • The core reads the file again at each call, so it sees changed credentials.
  • A JavaScript file that does not run gives an error with the kind of the error and its line, never the text of the file, which holds your keys. Node gives no line for a syntax error in an .mjs file: then node --check <file> shows it.
  • Keep the file outside your repository.

Log in to AWS

The core never logs you in. It uses the login that the AWS CLI keeps.

aws configure sso                          # one time: creates the profile
aws sso login --profile my-sso-profile     # once a day
How long a login lasts

The AWS CLI keeps the login in ~/.aws/sso/cache, so one aws sso login serves every process on the machine: Cypress, Mocha, Playwright, your scripts and the AWS CLI.

  • The session lasts as long as the administrator of IAM Identity Center set: 8 hours by default.
  • In that time, the AWS SDK renews the short role credentials on its own. Nothing asks you to log in.
  • Each run reads the secret with that login, in one call. A worker reuses the secret of its runner.
  • When the session ends, the run stops. The first line of the error says so and gives the command to copy: aws sso login --profile my-sso-profile. The SSO login script below runs it for you, and only when the session has ended.
Login scripts

The core ships two pairs of bash scripts. Each pair logs you in to AWS only when needed, then runs your command:

Method Your settings file The login script that it runs
AWS SSO sh/sso/aws_authenticate.sh sh/sso/aws_sso.sh: checks your SSO session, and logs you in when it has ended.
Assume role sh/assume_role/aws_authenticate.sh sh/assume_role/aws_assume_role.sh: assumes the role of the environment, and logs you in when needed.

1. Copy the settings file into your project once, then fill it in and commit it:

cp node_modules/aws-secrets-manager-core/sh/sso/aws_authenticate.sh .
  • The SSO file holds AWS_PROFILE_<ENV> and ACCOUNT_ID_<ENV> for each environment: TEST, STAGE, PROD and LOCAL, or your own names.
  • The assume-role file also holds ROLE_NAME, AWS_USER_ID_FILE_NAME, and USER_IDENTIFIER_PREFIX or USER_IDENTIFIER_SUFFIX.

2. Start your command through it, for example in package.json:

{
  "scripts": {
    "test:e2e": "bash aws_authenticate.sh test \"npx playwright test\""
  }
}

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm aws-secrets-manager-core

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229