Skip to content

The STC's resting identity is STC/STCGROUP, which holds ALTER on every data set — log on to a low-privilege userid at startup #97

Description

@mgrossmann

Measured on mvsdev, 2026-08-12, while investigating the identity questions behind #64. Same finding and same fix as mvslovers/httpd#177; filed here because it applies to this STC independently.

The finding

Every started task on an MVS 3.8j system running RAKF gets the same hardcoded identity, and on a system with the usual profile that identity is close to omnipotent.

RAKF0010I STC FTPD     STARTED USING DEFAULT STC ACCOUNT
RAKF0010I STC HTTPD    STARTED USING DEFAULT STC ACCOUNT

That message comes from WTOSTC in SRCLIB/ICHSFR00.hlasm, commented "Report when hardcoded STC account is used". The path reaching it does no lookup:

RACINOID CLC   =F'0',X'C'(R8)      STC ?          <- is a proc name present?
         BNE   RACISSTC
RACISSTC LA    R4,STCUID-L'CBLKNEXT POINT TO UID  <- one hardcoded answer
STCUID   DC    AL4(0),X'03',CL8'STC',X'08',C'STCGROUP'

RAKF has no started-procedures table: the procedure name decides that the caller is an STC, never which one. Combined with

DATASET *          STCGROUP  ALTER

FTPD's resting identity holds ALTER on every data set on the system.

Adding USER= to the PROC does not change this — the FTPD PROC is a plain EXEC PGM=FTPD today, but even with it, that RACINIT path consults nothing.

Why this could not be seen from outside the address space

Worth recording, because the obvious check is wrong. ASXBSENV lives in the ASXB, which is in each address space's private area — FTPD's and HTTPD's ASXB pointers are both 009DF300. Reading FTPD's through another address space's debugger returns that address space's own ACEE and looks entirely plausible. The RAKF0010I message at STC start is the reliable answer.

Why per-session logins do not mask it

racf_login() returns the new ACEE through the ACEE= pointer in the parameter list and "never reads or writes ASXBSENV" (libc370/src/racf/raclogin.c:47-51 — the no-ENQ change from #64). So an FTP session logging on does not disturb the resting identity: it stays STC/STCGROUP for the life of the address space, and anything that runs without an explicit ACEE falls back to it.

That is the same fallback #64 is about. This issue is the other half: #64 asks which identity a check should use; this asks what identity is there when nobody sets one.

Proposal

At startup, once APF authorization is in place and before accepting connections, log on to a configured low-privilege userid and install it:

ACEE *stc = racf_login(cfg_stc_user, NULL, cfg_stc_group, &rc);
if (stc) racf_set_acee(stc);

pass == NULL bypasses password checking (racf.h:24-25), so no password goes into a config file.

To settle:

  • Entitlements the userid actually needs — whatever FTPD opens before a client identity exists (its Parmlib member, logs). Enumerate, then grant exactly that. Everything a session touches must already go through the session's own ACEE; if anything does not, that is a finding in its own right and belongs with FTPD: cross-session ACEE race — OPEN-path racf_set_acee() switch is unserialized (ASXBSENV is address-space-wide) #64.
  • Config keywords, defaulting to today's behaviour so an unconfigured system is unchanged.
  • Failure policy — refuse to start, or continue on the inherited identity and log loudly.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions