FROM node:20-bookworm-slim

# Vulnerable by default (2.1.162); pass --build-arg CC_VERSION=2.1.163 for the
# patched build. Affected range: >=0.2.54, <2.1.163.
ARG CC_VERSION=2.1.162
RUN npm install -g @anthropic-ai/claude-code@${CC_VERSION}

# Isolated non-root user with its own HOME. No host config is ever mounted.
RUN useradd -m researcher
USER researcher
WORKDIR /home/researcher/lab

# Strict deny-by-default: a WebFetch permission prompt SHOULD fire here.
# If huggingface.co is fetched without a prompt, that is the vulnerability.
COPY --chown=researcher:researcher .claude/settings.json /home/researcher/lab/.claude/settings.json

# Benign canary — stands in for a "secret" the attacker wants to exfiltrate.
COPY --chown=researcher:researcher fixtures/canary.env /home/researcher/lab/.env

CMD ["bash"]
