Bug 16303 - Bitbake should prevent, if possible, obscured or hidden text from meta data.
Summary: Bitbake should prevent, if possible, obscured or hidden text from meta data.
Status: NEW
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 6.1 M3
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-06-01 16:15 UTC by Mark Hatle
Modified: 2026-06-04 16:26 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hatle 2026-06-01 16:15:32 UTC
It's unclear how possible this is, but...

See: https://arstechnica.com/security/2026/05/fed-up-with-vibe-coders-dev-sneaks-data-nuking-prompt-injection-into-their-code/

Recently a component "jqwik", an AI prompt was inserted into the code by the author and then hidden with ANSI codes in the case of TTY or simple review of the text files.

While in this instance it was specific to an AI prompt, the issue could be expanded to other code (shell or python) within recipes.

If bitbake could detect the situation where a layer was attempting to hide lines using ANSI codes (or similar) and warn/error about invalid characters that would go a long way toward helping prevent a similar situation.

The core layers have enough of a review structure that it is unlikely to affect them.  However, many BSP layers or speciality layers may have single maintainers or lesser review guidelines that could end up allowing the introduction of these types of instructions.

I am unaware of an existing parser or similar that we can use as an example of how to do this as a security measure.
Comment 1 Richard Purdie 2026-06-04 15:35:38 UTC
There are at least a couple of different potential ways of hiding text, either using extended unicode characters or using escape sequences that could affect a terminal window.

We need to ensure that our patch submission/review process doesn't allow such sequences to obscure text. 

As Mark mentions, for added protection, we may want to add checks to detect such sequences in metadata/recipes (e.g. in comments) of recipe files, just to ensure such issues would be flagged up.

For the purposes of resolving the bug, we should test such sequences and see how they look in different places and ensure we would notice them.
Comment 2 Mark Hatle 2026-06-04 16:26:08 UTC
The specific instance in the example used an ANSI escape sequence of ESC[2K to clear the line after it was printed.  This effectively hid the message from the terminal, but the AI still interpreted it.

There are other ANSI escape sequences that can be used to clear to the beginning of the line, word, etc.

One possible approach could be to reject or warn about the character sequence of 'ESC['.  Doing this would at least make it more clear if something fishy was happening.

Note, the unicode sequences can be used for similar behavior, and that is much more difficult to resolve.  I am unaware of any sort of standard unicode based character validation to prevent hidden or obscured text.