Back to Blog
high SEVERITY5 min read

How hardcoded AWS Access Key ID exposure happens in YAML template files and how to fix it

A hardcoded AWS Access Key ID (`AKIAVCODYLSA53PQK4ZA`) was discovered embedded in a signed S3 URL within the `CVE-2024-51482.yaml` nuclei template file. This credential, while part of a pre-signed URL reference link, was flagged as a high-severity finding because it exposes a real AWS access key in a public repository. The fix removes the entire reference URL containing the embedded credential.

O
By Orbis AppSec
Published July 22, 2026Reviewed July 22, 2026

Answer Summary

This vulnerability is a hardcoded AWS Access Key ID (CWE-798) detected in a YAML nuclei template file (`CVE-2024-51482.yaml`). The key `AKIAVCODYLSA53PQK4ZA` was embedded in a pre-signed S3 URL used as a reference link. The fix removes the entire URL containing the credential, eliminating the exposure from the production codebase. Static analysis tools like Semgrep can automatically detect AWS key patterns matching the `AKIA` prefix format.

Vulnerability at a Glance

cweCWE-798 (Use of Hard-coded Credentials)
fixRemove the reference URL containing the hardcoded AWS Access Key ID
riskCredential exposure enabling unauthorized AWS resource access
languageYAML (Nuclei template)
root causePre-signed S3 URL with embedded AWS credentials committed to source control
vulnerabilityHardcoded AWS Access Key ID in YAML template

How Hardcoded AWS Access Key ID Exposure Happens in YAML Template Files and How to Fix It

Introduction

In the nuclei templates repository, we discovered a high-severity hardcoded AWS Access Key ID embedded within http/cves/2024/CVE-2024-51482.yaml at line 15. The file is a nuclei security scanning template for ZoneMinder's CVE-2024-51482 SQL injection vulnerability, but ironically, the template itself contained a security flaw: a pre-signed Amazon S3 URL with a fully exposed AWS Access Key ID (AKIAVCODYLSA53PQK4ZA) committed directly to the repository.

This matters because anyone with access to the repository—which in the case of nuclei-templates is the entire internet—can extract this credential and potentially use it to access AWS resources associated with the AKIAVCODYLSA53PQK4ZA key.

The Vulnerability Explained

The vulnerable code was a reference URL in the template's metadata section:

reference:
  - https://securityonline.info/zoneminders-cve-2024-51482-a-10-10-severity-vulnerability-exposes-sql-databases/
  - https://github-production-user-asset-6210df.s3.amazonaws.com/104687644/381894613-3cc50e51-68cf-4540-8225-4288f73e0c08.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20241129%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241129T074108Z&X-Amz-Expires=300&X-Amz-Signature=9cc5b01b0482cbd5573c223a1d44e9ffed10afd7d042d76e8308dfcf3bb7e8a5&X-Amz-SignedHeaders=host
  - https://nvd.nist.gov/vuln/detail/CVE-2024-51482

The problematic element is the X-Amz-Credential query parameter, which contains:

AKIAVCODYLSA53PQK4ZA%2F20241129%2Fus-east-1%2Fs3%2Faws4_request

When URL-decoded, this reveals the full credential scope:

AKIAVCODYLSA53PQK4ZA/20241129/us-east-1/s3/aws4_request

Why This Is Dangerous

AWS Access Key IDs follow a predictable format: they start with AKIA followed by 16 uppercase alphanumeric characters. This makes them trivially detectable by automated scanners and malicious actors who scrape public repositories.

Attack Scenario: An attacker monitoring public commits to the nuclei-templates repository could:

  1. Extract AKIAVCODYLSA53PQK4ZA from the YAML file
  2. Pair it with any leaked or brute-forced secret access key associated with this ID
  3. Attempt to access the GitHub production S3 bucket (github-production-user-asset-6210df.s3.amazonaws.com)
  4. Even without the secret key, the access key ID itself reveals the AWS account structure and can be used for reconnaissance

While pre-signed URLs are designed to be temporary (this one had a 300-second expiry), the Access Key ID itself is a long-lived credential that doesn't expire with the URL. It identifies the IAM user or role and can be used in targeted attacks against the associated AWS account.

The Fix

The fix is straightforward but effective: the entire pre-signed S3 URL was removed from the reference list.

Before:

reference:
  - https://securityonline.info/zoneminders-cve-2024-51482-a-10-10-severity-vulnerability-exposes-sql-databases/
  - https://github-production-user-asset-6210df.s3.amazonaws.com/104687644/381894613-3cc50e51-68cf-4540-8225-4288f73e0c08.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20241129%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241129T074108Z&X-Amz-Expires=300&X-Amz-Signature=9cc5b01b0482cbd5573c223a1d44e9ffed10afd7d042d76e8308dfcf3bb7e8a5&X-Amz-SignedHeaders=host
  - https://nvd.nist.gov/vuln/detail/CVE-2024-51482

After:

reference:
  - https://securityonline.info/zoneminders-cve-2024-51482-a-10-10-severity-vulnerability-exposes-sql-databases/
  - https://nvd.nist.gov/vuln/detail/CVE-2024-51482

Why This Change Works

  1. Eliminates the credential from the codebase: The AWS Access Key ID no longer exists in the current version of the file
  2. Preserves functionality: The removed URL was a reference link to a demo video—not essential for the template's scanning capability
  3. Retains useful references: The SecurityOnline article and NVD links remain, providing adequate context for the CVE
  4. Reduces attack surface: No AWS credentials of any kind remain in the template

The pre-signed URL was likely copied directly from a browser's address bar when someone was viewing a proof-of-concept video on GitHub. This is a common mistake—GitHub generates pre-signed S3 URLs for user-uploaded assets, and developers inadvertently commit these URLs without realizing they contain embedded credentials.

Prevention & Best Practices

For Template and Configuration Authors

  1. Never paste pre-signed URLs into committed files: If you need to reference an S3-hosted asset, use the permanent GitHub URL (e.g., https://github.com/user/repo/assets/...) rather than the underlying S3 pre-signed URL
  2. Use permalink formats: GitHub provides stable URLs for uploaded content that don't expose AWS infrastructure details
  3. Review URLs before committing: Check for query parameters like X-Amz-Credential, X-Amz-Signature, or aws_access_key_id

For Repository Maintainers

  1. Implement pre-commit hooks: Use tools like git-secrets or detect-secrets to scan for AWS key patterns before commits are accepted
  2. Enable Semgrep CI scanning: The rule generic.secrets.security.detected-aws-access-key-id-value catches this exact pattern
  3. Rotate exposed credentials immediately: Even if the key was for a pre-signed URL, the underlying IAM credentials should be rotated
  4. Scrub git history: Use git filter-branch or BFG Repo-Cleaner to remove the credential from historical commits

Detection Patterns

The AWS Access Key ID format is well-defined:
- Always starts with AKIA (for long-term keys) or ASIA (for temporary credentials)
- Followed by exactly 16 uppercase alphanumeric characters
- Regex: AKIA[0-9A-Z]{16}

Key Takeaways

  • Pre-signed S3 URLs contain real AWS credentials: The X-Amz-Credential parameter in any pre-signed URL exposes the Access Key ID used to generate the signature—never commit these to version control
  • Reference links in YAML templates are still production code: Even metadata fields like reference: in nuclei templates are scanned and should be treated with the same security rigor as executable code
  • GitHub asset URLs have two forms: The stable permalink (github.com/.../assets/...) and the underlying S3 pre-signed URL—always use the former in committed files
  • Expired pre-signed URLs still expose long-lived credentials: The 300-second URL expiry doesn't protect the Access Key ID, which remains valid until explicitly rotated
  • The AKIA prefix is a reliable detection signal: Any string matching AKIA[0-9A-Z]{16} in source code is almost certainly a real AWS Access Key ID that needs remediation

How Orbis AppSec Detected This

  • Source: A pre-signed Amazon S3 URL pasted as a reference link in the YAML template's info.reference section
  • Sink: The X-Amz-Credential query parameter at http/cves/2024/CVE-2024-51482.yaml:15, containing the literal value AKIAVCODYLSA53PQK4ZA
  • Missing control: No credential scanning or pre-commit validation was in place to prevent AWS key patterns from being committed to the repository
  • CWE: CWE-798 (Use of Hard-coded Credentials)
  • Fix: Removed the entire pre-signed S3 URL from the reference list, eliminating the hardcoded AWS Access Key ID from the production codebase

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.

Conclusion

This vulnerability demonstrates a subtle but common way credentials end up in source control: not through intentional hardcoding, but through copy-pasting URLs that happen to contain embedded authentication tokens. Pre-signed S3 URLs are particularly insidious because they look like ordinary web links but carry real AWS credentials in their query parameters.

The fix was simple—remove the offending URL—but the lesson is important: every URL, every reference link, and every piece of metadata in your codebase should be treated as potentially sensitive. Automated scanning with tools like Semgrep makes it possible to catch these issues before they reach production, and credential rotation should follow any exposure, regardless of how the credential was used.

References

Frequently Asked Questions

What is a hardcoded AWS Access Key ID vulnerability?

It occurs when an AWS access key (a string starting with `AKIA` followed by 16 alphanumeric characters) is embedded directly in source code or configuration files rather than being stored securely in environment variables or secret management systems.

How do you prevent hardcoded AWS credentials in YAML files?

Use environment variable references, AWS IAM roles, or secret management tools like AWS Secrets Manager. Never paste pre-signed URLs containing credentials into files that will be committed to version control.

What CWE is hardcoded credential exposure?

CWE-798 (Use of Hard-coded Credentials) covers scenarios where authentication credentials are embedded directly in source code or configuration files.

Is removing the URL enough to prevent credential exposure?

Removing the URL from the current codebase prevents future exposure, but the credential may still exist in git history. The AWS key should also be rotated immediately since it was exposed in a public repository.

Can static analysis detect hardcoded AWS credentials?

Yes, tools like Semgrep use pattern matching to detect strings matching the AWS Access Key ID format (`AKIA[0-9A-Z]{16}`), which is exactly how this vulnerability was identified.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #16616

Related Articles

high

How Quadratic CPU Consumption Vulnerabilities Happen in JavaScript YAML Parsers and How to Fix Them

A high-severity denial-of-service vulnerability in js-yaml versions 3.x and 4.x allowed attackers to trigger quadratic CPU consumption through specially crafted YAML documents using the !!omap tag. This fix upgrades js-yaml from 4.1.1 to 4.3.1 and from 3.14.2 to 3.15.1, eliminating the algorithmic complexity attack vector that could freeze Node.js applications processing untrusted YAML input.

high

How javascript.lang.security.detect-child-process.detect-child-process happens in Node.js and how to fix it

A high-severity command injection vulnerability was discovered in `scripts/build.js` where `execSync` was called with string-interpolated arguments (`sourceDir` and `outputPath`) inside a shell command. By replacing `execSync` with `spawnSync` using an argument array (no shell), the fix eliminates the possibility of shell metacharacter injection while preserving identical build behavior.

high

How Command Injection happens in Node.js child_process and how to fix it

A command injection vulnerability in nix.js's Release class allowed potentially malicious input through the `arch` parameter to be executed via shell commands. The fix replaced `execSync()` with `execFileSync()`, eliminating shell interpretation and preventing command injection by passing arguments as an array instead of a concatenated string.

critical

How Sensitive Data Exposure in Error Logging happens in TypeScript/Deno and how to fix it

A critical vulnerability in Supabase Edge Functions allowed sensitive authentication errors and API credentials to leak through verbose error logging. The `cancel-subscription/index.ts` function logged full error objects to the console, potentially exposing Paddle API keys and auth tokens in deployment logs. The fix sanitizes all error messages to log only safe error text while preserving debugging capability.

critical

How HTTP Header Injection Happens in Go and How to Fix It

A critical vulnerability in the file upload handler allowed attackers to inject CRLF sequences into HTTP response headers through crafted filenames. The fix sanitizes user-supplied filenames before using them in Content-Disposition headers, preventing header injection attacks that could lead to cache poisoning, session fixation, or XSS.

high

How Path Traversal and Security Policy Bypass Happens in Node.js Dependencies and How to Fix It

A high-severity vulnerability in the fast-uri package (CVE-2026-6321) allowed attackers to bypass security policies through improper Unicode hostname canonicalization and path traversal. This issue affected the @apralabs/apra-fleet project through its dependency tree, and was resolved by upgrading fast-uri from version 3.1.0 to 4.1.2 using npm overrides.