T09 · Insecure Skill Coding Practices
- Location
scripts/batch_create.py:153- Finding
Notion API Token Can Be Exposed Through Command-Line Arguments
- Content
View full analysis
Notion property mapping') args = parser.parse_args() with open(args.schema, 'r') as f: schema = json.load(f) api_token = args.api_token or os.environ.get('NOTION_API_TOKEN') if not api_token: raise ValueError("API token required via --api-token or NOTION_API_TOKEN environment variable") ``` ### Technical Analysis The CLI accepts a Notion bearer token through `--api-token`. Command-line arguments can be exposed through: - Process inspection facilities such as `ps`, `/proc//cmdline`, or system monitoring software. - Shell history files when a user enters the token directly in a command. - CI/CD job logs, command tracing, terminal recordings, and process audit logs. - Diagnostic output collected by orchestration or endpoint-management systems. The token is subsequently placed in the `Authorization` header by `NotionDBClient`. Sending it to the fixed HTTPS endpoint `https://api.notion.com/v1` is necessary for the declared functionality; the security issue is the optional command-line credential transpo ...[truncated 1328 chars]- Remediation
View remediation
