Skip to content

jcl: high_risk_execution counts every EXEC PGM=, so a compiler step and IEFBR14 score as arbitrary execution (design question) #2751

Closed

Description

@squid-protocol

Found by the #2669 pass over every non-green cell in the keyword-rosetta bias report (2026-09-05, engine 0e521e8). jcl/high_risk_execution sits amber-low (2 vs a median of 3) only because the corpus avoids the rule: its manifest notes say "EXEC PGM= is high_risk per occurrence, so probes use the EXEC form", and its two danger plants are PGM=IEFBR14 — a program that does nothing.

The rule

jcl.py L82, comment "Danger (Execution of arbitrary programs)":

"high_risk_execution": re.compile(r"\bPGM=[A-Za-z0-9_#$@]+\b", re.I),

Every EXEC PGM= is a hit. Running a program is what a JCL step is, so the rule measures "how many steps name a program" rather than "how many steps execute something arbitrary". On language-crucible (186 files, 77bc85e): 190 PGM= across 376 EXEC statements, distributed as

program hits what it does
IKJEFT01 60 TSO batch — runs whatever commands SYSTSIN carries (this one is arbitrary execution)
IEFBR14 26 no-op; run only for its DD allocation/deletion side effects
IDCAMS 16 catalog utility (DEFINE/DELETE clusters)
IGYCRCTL / IEWL / IEWBLINK / ASMA90 / IBMZPLI 26 compilers and the linker
ICEGENER / IEBGENER / IEBCOPY 12 copy utilities
CICS/DB2 utilities (DFHCSDUP, DFHSIP, DFHTU730, …) 12
application programs (CBL0001, SAM1, …) 38 the job's own payload

A compile-link-go job scores three high-risk executions for compiling; a job that deletes a dataset through IEFBR14 + DISP=(MOD,DELETE,DELETE) scores one for the no-op and zero for the deletion.

Why this is a cross-language consistency question

The other 45 high_risk_execution rules do not count "runs a command": shell counts eval/exec/rm -rf /, not every command line; dockerfile counts eval/exec/rm -rf /, not every RUN; python counts eval/exec/os.system, not every call. The rosetta corpus plants the same two danger tokens in every language and reads 2 (the corpus median is 3 only because most languages also count the danger-only string decoy, which JCL's comment stream cannot carry). JCL is the one language where the honest equivalent — a program that executes caller-supplied commands — cannot be planted without the rule also counting the surrounding no-op steps.

Candidate shape (maintainer call on the set)

# Programs whose purpose is to execute caller-supplied commands: TSO batch
# (IKJEFT01/1A/1B), the z/OS UNIX shell (BPXBATCH/BPXBATSL), REXX (IRXJCL).
# A compiler, a copy utility or IEFBR14 is a step, not arbitrary execution.
"high_risk_execution": re.compile(
    r"\bPGM=(?:IKJEFT0?1[AB]?|IKJEFT1[AB]|BPXBATCH|BPXBATSL|IRXJCL)\b", re.I
),

Whether IDCAMS/IEHPROGM/ADRDSSU (catalog and volume surgery) belong in the set is the design question; the compilers and IEFBR14 clearly do not. screen_plant.py: //STEP4 EXEC PGM=IKJEFT01 fires high_risk_execution 1 + func_start 1, same as today's shape, so the change is purely which programs qualify.

Corpus pairing

keyword-rosetta's two PGM=IEFBR14 plants (main.jcl PROBERISK, STEP2) would read 0 under the narrowed rule, so the plant moves to PGM=IKJEFT01 / PGM=BPXBATCH in the same re-bless — high_risk_execution stays 2 and the "probes use the EXEC form" workaround becomes unnecessary. This is the paired-work shape of AGENTS.md rule 8 in reverse (a narrowing that needs a re-plant, not a widening that needs one).

Part of #2669 (rosetta[jcl] was #2581). Siblings from the same pass: jcl api, jcl cleanup, jcl globals.


Filed together on 2026-09-05: jcl api #2748 · jcl cleanup #2749 · jcl globals #2750 · jcl high_risk_execution #2751 · css io #2752 · yaml args #2753. Corpus-side pairings: squid-protocol/keyword-rosetta#59.

Activity

  1. added
    question
    metrics
    core-engine
    threat: false-positive
    on Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-enginemetricsquestionthreat: false-positive

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions