Join our Newsletter — 33% off our NHI Course

ComfyUI PNG metadata leaks: what security teams need to know

 

(@nhi-mgmt-group)
Member Moderator
Joined: 1 year ago
Posts: 16521
Topic starter  

TL;DR: Truffle Security found that ComfyUI PNG exports can embed prompts, workflow state, file paths and live API keys by design, and across ten Discord servers it identified 159,752 metadata-bearing images, including 681 with verified live keys. Casual image sharing becomes an NHI governance problem when secrets ride inside the artifact itself.

Editorial analysis by NHI Mgmt Group, based on content published by Truffle Security: “API Keys Leaking in PNG Metadata of AI Images”.

By the numbers:

Key questions

Q: What breaks when AI image tools save workflow state into shared PNG files?

A: The control break is that the file becomes a secret-bearing artifact instead of a neutral output.

Q: Why do embedded API keys in generated images create more risk than a simple file leak?

A: Because the image can preserve both the credential and the surrounding workflow context.

Q: What are the signs that image-generation workflows are leaking sensitive data?

A: Look for exported files that contain prompts, file paths, node names, webhook URLs, local IP addresses or live secrets when decoded.

Practitioner guidance

  • Strip metadata before sharing Re-encode generated PNGs so hidden text blocks, EXIF and workflow state are removed before the file leaves your environment.
  • Block plain text secret fields in custom nodes Review community nodes that accept API keys, tokens or webhooks in ordinary text widgets and remove workflows that persist credentials in canvas state.
  • Scan exported artifacts for secrets Run secret detection against rendered images and other generated files, not just source repositories, build logs and configuration stores.

Bottom line: ComfyUI-style image exports can turn a routine sharing action into a secret exposure event when workflow state and credentials are embedded in the file.

What's in the full article

Truffle Security's full article covers the operational detail this post intentionally leaves for the source:

  • The exact metadata blocks ComfyUI writes into PNG files and how they differ between prompt and workflow data
  • The scanning method used to verify live API keys inside exported images across public Discord communities
  • Concrete examples of leaked prompts, file paths, network addresses and Google Drive links found in the corpus
  • The one-line cleanup and verification workflow used to confirm that metadata stripping removed the exposed secrets

👉 Read Truffle Security's analysis of ComfyUI PNG metadata and secret exposure →

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →



   
Quote
(@mr-nhi)
Member Moderator
Joined: 5 months ago
Posts: 17012
 

Artifact-level secret leakage is now part of the NHI attack surface: This article shows that a credential no longer has to live in code, CI logs or a vault export to become exposed. When a workflow platform serialises widget values into a shared PNG, the artifact itself becomes a secret container. The practitioner conclusion is that output governance must sit alongside credential governance.

A few things that frame the scale:

  • 80% of identity breaches involved compromised non-human identities such as service accounts and API keys, according to the Ultimate Guide to NHIs.
  • DeepSeek alone generated 113,000 new exposed API keys in 2025, illustrating how new AI providers create credential exposure before security guardrails catch up, according to the State of Secrets Sprawl 2026.

A question worth separating out:

Q: How should teams govern third-party nodes that accept API keys in AI workflows?

A: Treat every custom node that accepts credentials as part of the identity perimeter and review how it stores, serialises and exports those values. If the node writes secrets into saved artifacts, it needs the same scrutiny as any other credential-handling integration in the environment.

👉 Read our full editorial: ComfyUI PNG metadata turns image sharing into secret exposure



   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.