SecLab
Injection & Output EncodingchallengeDifficulty 4/537 min

Challenge: four interpreters, one principle

Objective: After this lesson you can name the interpreter in unfamiliar code and pick the right fix without a lookup table.

V1CWE-1336CWE-78CWE-89A05:2025
Step 1 of 5 · read3 min

The goal

The previous five lessons taught four concrete interpreters: SQL, the ORM, HTML, a shell, XML. This lesson tests something else: whether you recognise an interpreter no lesson taught you.

Because at work the sixth interpreter always turns up — a template engine, an expression library, a rules runner, an LDAP query, a log format string. No list covers them all, so the thing worth learning is how to recognise one.

Three questions, and they suffice for every interpreter you will meet:

  1. Does this data reach something that will parse it? If it is only stored or compared, it is not injection.
  2. Is there a protocol-level boundary between command and data? Yes → parameterise. No → you must build the boundary yourself, usually with an allow-list.
  3. Does the data ever become syntax rather than a value? If so, no API can parameterise it — it needs mapping to a constant.

What to produce. Four snippets, four interpreters, at least one absent from the previous five lessons. For each: name the interpreter, state the correct fix, and say why the fix for a different interpreter does not work here. The third part is what counts.

View path

Comments

Join the discussion
Sign up to comment

Commenting needs an account with at least one completed lesson. That condition is what keeps this thread worth reading: every point belongs to someone who can be asked back, and reputation accrues over time.

Sign upSign in

You can still read every comment below without an account. Signing in brings you back to this exact spot, not to the top of the page.

Loading comments…