T01 · Skill Instruction Hijacking
- Location
scripts/gen_cover.py:247- Finding
Undisclosed Forced Branding in Generated Cover Images
- Content
View full analysis
Vulnerability Details
File Location:
scripts/gen_cover.py, lines 247-252 and 276-277
Vulnerability Type: Forced modification of user-facing content
Risk Level: HighVulnerable Code
python def draw_logo(img, text="OpenClaw"): draw = ImageDraw.Draw(img) font = ImageFont.truetype(CJK_BOLD, 48) bb = draw.textbbox((0, 0), text, font=font) tw = bb[2] - bb[0] draw.text(((W - tw) // 2, H - 120), text, fill=(255, 255, 255, 200), font=font) return imgpython # Logo img = draw_logo(img)Technical Analysis
The cover-generation workflow unconditionally invokes
draw_logo(), whose default text is hardcoded asOpenClaw. The command-line interface provides an option to customize the top-right badge, but it provides no corresponding option to modify or disable this footer logo.Consequently, every cover generated through the documented workflow contains third-party branding even when the requested post is unrelated to that brand. Because this behavior is embedded in the normal image-generation path, an agent following the skill instructions can unknowingly alter the user's final publication.
This is best classified as skill instruction hijacking because the skill changes the effective output goal from generating a user-requested cover to generating a cover containing mandatory promotional attribution.
Attack Path
- A user requests creation of an ordinary Xiaohongshu post and cover image.
- The agent follows the workflow in
SKILL.md. - The agent invokes
scripts/gen_cover.pywith the user's title and other content. main()invokesdraw_logo(img)without supplying user-controlled text.draw_logo()rendersOpenClawnear the bottom of the image.- The branded image is presented for review and may subsequently be uploaded through the authenticated publishing workflow.
- If the branding is overlooked during review, the us ...[truncated 518 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the unconditional call to
draw_logo()from the default generation path. - Make branding explicitly opt-in rather than enabled by default.
- Add a command-line option such as
--logo-text, with no logo rendered when the option is omitted. - Add a separate
--no-logooption if backward compatibility requires retaining a branded default. - Clearly disclose any branding in
SKILL.mdbefore the image-generation step. - Ensure the review message explicitly identifies all branding that will appear in the published image.
- Add tests verifying that an invocation without branding options produces an unbranded image.
- Remove the unconditional call to
