Session and built-in variables are not protected: $SESSION_PASSWORD is logged in clear, built-ins are writable, arithmetic clears the secret flag

Open
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
security

Research direction

Start with src/script_executor.cpp, reading setInitialVariables() and the INC/DEC/ADD handling around lines 337–351. Trace how variable metadata is set during initialization and arithmetic, and how SET treats built-ins. Reproduce the reported cases; done means session credentials are masked in logs, built-ins cannot be overwritten, and arithmetic preserves secret status.

Written by the indexing model from the issue text.

Description

bug
Summary

setInitialVariables() stores $SESSION_* values with secret = false, so LOG "pw=$SESSION_PASSWORD" writes the password to the session log, whereas INPUT PASSWORD values are masked. Built-ins such as $SCREEN_ROWS can be overwritten with SET, and INC/DEC/ADD on a secret variable clear its secret flag.

Location
  • File(s): src/script_executor.cpp
  • Line(s) / function(s): initial variables L72–L74; INC/DEC/ADD L337–L351
Category

security

Severity

medium

Saved-session passwords passed to startup scripts end up in logs.

Reproduction / Evidence

Reproducible at runtime: initial $SESSION_PASSWORD=s3cret, LOG "pw=$SESSION_PASSWORD" → pw=s3cret. SET $SCREEN_ROWS 5 then LOG "$SCREEN_ROWS" → 5.

Expected Behavior

$SESSION_PASSWORD (and other credentials) are secret; built-ins are read-only; derived values keep the secret flag.

Actual Behavior

As above.

Root Cause

secret=false for initial variables; no read-only set; arithmetic re-sets variables without the flag.

Dominant language
C++
Stars
1
Forks
2
Avg merge
1h 34m
Merged PRs (30d)
7

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 5250ng/5250script

All issues in 5250ng/5250script

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.