T09 · Insecure Skill Coding Practices
- Location
deepaistudy_prep.py:41- Finding
Authentication Password Stored in Plaintext with Insufficient File Protection
- Content
View full analysis
configparser.ConfigParser: config = configparser.ConfigParser() CONFIG_DIR.mkdir(parents=True, exist_ok=True) if CONFIG_FILE.exists(): config.read(CONFIG_FILE) if not config.has_section("default"): config.add_section("default") return config def save_config(config: configparser.ConfigParser) -> None: CONFIG_DIR.mkdir(parents=True, exist_ok=True) with open(CONFIG_FILE, "w") as f: config.write(f) ``` The password is configured through the documented command: ```text deepaistudy-prep config set password your_password ``` ### Technical Analysis The application stores its server address, username, and password in `~/.config/deepaistudy-prep/config.ini` through Python's `configparser`. The file is written as an ordinary text file, and the code does not explicitly enforce owner-only permissions such as mode `0600`. The password is therefore recoverable as plaintext by any process or user able to read the configuration file. Actual exposure depends on the operating system's effective umask and the permissions of the user's configuration directories, but security-sensitive code should not rely on environmental defaults for credential protection. The documented interface also accepts the password as a command-line argument. This can expose it through shell history and, depending on the operating system, process inspection while the command is running. This behavior is not necessary for the declared PDF and image processing functionality. Authentication is necessary for the remote service, but persistent plaintext password storage is not the least-privilege or least-exposure approach. ### Attack Path ...[truncated 1197 chars]- Remediation
View remediation
