From Font Files to Backdoors: How Attackers Hide Credential Stealers Inside Repo Assets

Application Security

Flyingduck Security Research Team

How to detect exposed secrets in repo assets and stop CI-driven credential stealers before they spread.

From Font Files to Backdoors: How Attackers Hide Credential Stealers Inside Repo Assets

In a single large-scale scan, researchers reported more than 42,000 exposed tokens discovered across applications, the kind of accidental credential exposure attackers hunt for when they weaponize CI pipelines and repository assets (fonts, images, npm tarballs) as carriers.

Detect exposed secrets isn’t a checkbox. It’s a capability that must operate at commit time, during CI runs, and across the supply chain. The frequency of exposures is rising: one study found secrets sprawl accelerated 67% year-over-year, a clear signal that opportunistic attacks will keep exploiting careless asset bundling and dependency tampering (GitGuardian analysis) (https://arxiv.org/html/2307.00714v1). Meanwhile, targeted scans of millions of applications turned up tens of thousands of tokens left in the wild (https://drj.com/industry_news/intruder-uncovers-new-secrets-detection-techniques-finds-thousands-of-exposed-tokens-unaddressed-by-traditional-methods).

This post explains how attackers hide credential stealers inside repo assets, what detection actually looks like for engineering and security teams, and which practical controls, applied with tools like Secrets detection, Commit Analysis, SCA and SAST, reduce risk.

How attackers hide credential stealers inside ordinary repo assets

Attackers follow the path of least resistance. If a repo stores non-code assets (fonts, images, packaged modules, CI configuration), adversaries will try to smuggle code or encoded payloads into those files in ways that evade simple pattern matching.

Examples observed in real incidents include:

  • Trojanized packages that bundle runtime components or installers inside benign-looking assets. These payloads execute at install or in CI steps.
  • Encoded payloads placed inside font or image files; obfuscated stubs in repository assets fetch and run a credential stealer in CI contexts.
  • Malicious commits that add configuration or pipeline tasks exposing secrets to external hosts during build.

These attack vectors succeed when secret detection is limited to regex rules, when scanning is infrequent, or when scanning ignores non-text assets and binary blobs.

Why detect exposed secrets at commit and CI time

A large academic and industrial body of work shows that tooling that only flags potential secrets after they reach the VCS or production is too slow. In one industrial study, only about half of the potential secrets flagged by detection tools were actually committed; the rest were blocked earlier, showing the value of pre-commit and pre-merge controls (https://pmc.ncbi.nlm.nih.gov/articles/PMC8928718).

Detecting exposed secrets early reduces blast radius in three ways:

  • It prevents credentials from entering the repository history where they persist.
  • It blocks automated CI steps from leaking tokens to public endpoints or attacker infrastructure.
  • It stops attackers from harvesting secrets en masse from many repos once a single poisoned package propagates.

Teams should assume opportunistic scanning by attackers will find any exposed secrets that reach public or lightly guarded repos. The right defense is multi-layered detection that runs at commit, in CI, and in supply-chain scans.

What good detection looks like (technical checklist)

Detection mechanisms must be complementary. No single pattern or signature will find everything.

  1. Commit-level scanning: run secrets detection at the commit hook and as part of the pre-merge pipeline. Block or flag pushes that contain candidate secrets and binaries that have embedded code.

  2. Context-aware heuristics: combine entropy checks with pattern context (e.g., API key formats plus the surrounding file path and language). Entropy-only detectors raise noise; context reduces false positives.

  3. Asset-aware scanning: index and scan non-code assets (fonts, images, archives). Use unpacking routines for tarballs and npm packages so detection can see embedded files.

  4. SCA and SBOM correlation: tie detected secrets or suspicious package changes to your SBOM and Software Composition Analysis tooling. A change in a transitive dependency should trigger re-scan of CI steps that reference it.

  5. CI policy enforcement: restrict steps that execute arbitrary scripts from third-party packages. Detect when pipeline definitions reference external URLs or shells that could exfiltrate secrets.

  6. Continuous monitoring and credential hygiene: when a secret is detected, rotate credentials, revoke access, and run a focused scan across your repositories and CI logs.

Implementing these points requires integration between scanning engines and developer workflows: pre-merge gates, developer-friendly remediation guidance, and prioritized alerts so engineers fix high-risk issues first.

Practical detection techniques for credential-stealing payloads

There are several proven methods that go beyond simple regex:

  • Signature and fingerprinting: identify compiled stubs or known malware fingerprints inside archives and binaries.
  • Layered unpacking: recursively extract archives (npm tarballs, zip, jar) and scan all contents rather than only root files.
  • Behavioral heuristics for CI steps: flag pipeline steps that do network pulls during build or use environment variables without explicit masking.
  • Dependency provenance checks: verify publishers and package integrity; suspicious package owners or unusual version bumps should trigger deeper inspection.

These methods reduce time-to-detection against credential stealers hidden in assets. They also produce fewer false positives when paired with SBOM and SCA data to explain why a file exists.

Prioritization: which exposed secrets to fix first

Not all secrets carry equal risk. Effective triage focuses scarce remediation effort where it matters:

  • Production-grade tokens (cloud provider keys, database passwords), highest priority.
  • Long-lived service credentials, second priority; rotate immediately if discovered in a repo or CI log.
  • Short-lived tokens and developer API keys, medium priority but rotate and audit usage.
  • Secrets embedded in widely reused packages or assets, treat as high risk because they can propagate.

Signals for prioritization include token scope, creation date, usage metadata, and presence in CI logs. Combining these signals with SCA and SBOM context helps teams decide where to act first.

Shortcomings of traditional secret detectors and how teams should adapt

Academic and industry studies show existing tools miss meaningful exposures or generate noise when used alone. For instance, secret-detection tools report potential secrets that need contextual validation; blind trust in any single tool produces gaps (https://arxiv.org/html/2307.00714v1, https://pmc.ncbi.nlm.nih.gov/articles/PMC8928718).

To adapt, security teams should:

  • Use multiple detection signals (regex, entropy, heuristics, fingerprints).
  • Integrate detection into developer workflows so fixes happen as part of normal code review and CI.
  • Correlate findings with SCA and SBOM data to see the upstream and downstream impact of a compromised asset.

Tools that combine commit-level scanning, SCA, and SAST workflows reduce friction for developers and give security teams higher-fidelity alerts.

Response playbook when a credential stealer is found in an asset

  1. Quarantine the artifact and identify all repositories and CI runs that consumed it.
  2. Rotate and revoke exposed credentials immediately.
  3. Rebuild artifacts from verified sources. If a package registry was poisoned, prefer pinned, verified versions in the SBOM.
  4. Apply pre-merge and CI rules to prevent recurrence (block certain pipeline behaviors, require signed packages).
  5. Run a retrospective scan across all repos and CI logs for similar indicators.

This sequence minimizes exposure while creating a repeatable incident workflow.

How Flyingduck maps these detection needs to product capabilities

Flyingduck combines Commit Analysis, Secrets detection, Software Composition Analysis (SCA), and SAST to detect exposed secrets and credential-stealing patterns across the SDLC. Pre-merge commit scanning blocks accidental secret commits; SCA and SBOM correlation show where a poisoned package will land in deployed systems; SAST and Deep Logic Analysis Engine find logic patterns that allow secrets to leak during build.

Teams that want to see these capabilities in action can Book a Demo of the Deep Logic Analysis Engine and explore Commit Analysis, SCA, and Secrets detection to build a multi-layered detection posture. Links to documentation and product pages are available to help map these features to existing workflows.

Book a demo or Contact Us to evaluate how these controls fit existing CI and SBOM processes (https://flyingduck.io/contact-us).


Featured resources from this site:

  • Commit Analysis | Flyingduck (/commit-analysis)
  • Software Composition Analysis (SCA) (/sca)
  • Developer-First Static Application Security Testing (SAST) (/sast)
  • Secrets (/secrets)

End takeaway: detecting exposed secrets requires asset-aware scanning, commit-time enforcement, and SCA/SBOM context. When teams apply those controls consistently, credential-stealing campaigns that hide in fonts, packages, or CI tasks lose their edge.

Frequently Asked Questions

What does it mean to detect exposed secrets in a repository?

Detecting exposed secrets means finding sensitive credentials — API keys, service tokens, passwords — that are present in source code, commit history, CI logs, or bundled assets. Effective detection combines commit-level scanning, CI checks, and dependency-aware analysis rather than relying only on simple regexes.

Can secrets detection find payloads hidden inside images or font files?

Yes, when tools unpack and scan non-code assets and archives. Asset-aware scanners that extract archives and inspect embedded files are required to catch payloads encoded into fonts, images, or tarballs.

Where should secrets detection run to catch credential stealers early?

Run detection at commit hooks and pre-merge, as part of CI checks, and within supply-chain scans tied to SCA and SBOM. Early detection blocks credentials from entering VCS and prevents CI runs from leaking tokens.

How should teams prioritize exposed secrets they find?

Prioritize production-grade and long-lived credentials first, then service credentials and widely reused tokens. Use token scope, age, usage logs, and whether the secret is embedded in a shared package to rank remediation.

What immediate steps should the team take after finding a credential-stealing payload?

Quarantine the artifact, rotate and revoke exposed credentials, rebuild from verified sources, apply CI and pre-merge rules to block recurrence, and run a full retrospective scan across repos and CI logs.

Sources

Related reading