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

critical

How arbitrary code execution via injected protobuf definition type fields happens in Node.js and how to fix it

A critical arbitrary code execution vulnerability (CVE-2026-41242) was discovered in protobufjs versions prior to 7.5.5 and 8.0.1, allowing attackers to inject malicious code through crafted protobuf definition type fields. The fix upgrades the dependency from the vulnerable version 6.11.4 to 7.5.5, which properly sanitizes type field inputs during protobuf parsing. This vulnerability is especially dangerous because protobufjs is widely used in Node.js applications for serialization, meaning a s

high

How command injection happens in Node.js child_process and how to fix it

A high-severity command injection vulnerability was discovered in `bootstrap.js` at line 34, where the `exec()` function was used to run shell commands constructed from a `folder` variable. By replacing `exec()` with `execFile()` and passing arguments as an array, the fix eliminates the shell interpolation entirely, closing the door on command injection attacks that could have affected all downstream consumers of this Node.js library.

high

How unsafe pickle deserialization happens in NumPy's np.load() and how to fix it

A high-severity arbitrary code execution vulnerability was discovered in `tools/ardy-engine/retarget.py` where `np.load()` was called with `allow_pickle=True`, enabling attackers to embed malicious pickle payloads in `.npz` files. The fix was a single-character change—switching `allow_pickle=True` to `allow_pickle=False`—that eliminates the deserialization attack vector while preserving the file's legitimate array data loading functionality.

high

How SSRF and Credential Leakage via Absolute URLs happens in axios and how to fix it

A high-severity vulnerability (CVE-2025-27152) in axios versions prior to 1.8.2 allowed Server-Side Request Forgery (SSRF) attacks and credential leakage when making HTTP requests with absolute URLs. This vulnerability was fixed by upgrading from axios 1.7.4 to 1.8.2 in both package.json and package-lock.json, eliminating the attack vector that could have exposed authentication tokens and enabled unauthorized server-side requests.

high

How pickle-based arbitrary code execution happens in PyTorch and how to fix it

A high-severity arbitrary code execution vulnerability was discovered in `scripts/export_joyvasa_audio.py` where `torch.load()` was called with `weights_only=False`, allowing any pickle-serialized Python object — including malicious code — to execute during checkpoint loading. The fix switches to `weights_only=True` and explicitly allowlists only the two non-standard classes the checkpoint actually requires: `argparse.Namespace` and `pathlib.PosixPath`. This closes a real code execution path tha

critical

How WebSocket protocol length header abuse happens in Node.js and how to fix it

A critical vulnerability (CVE-2026-54466) in websocket-driver versions prior to 0.7.5 allows attackers to corrupt WebSocket messages by manipulating protocol length headers. This can lead to data integrity issues, denial of service, or potentially arbitrary code execution in affected Node.js applications. The fix involves upgrading the websocket-driver dependency to version 0.7.5.