Dynamic attribute access via getattr()
Low
- Category
- Dangerous Code Execution
- Content
# Allow env override env_level = os.environ.get("CLAWHUB_LOG_LEVEL", "").upper() if env_level in ("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"): level = getattr(logging, env_level) logging.basicConfig( level=level, format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",- Confidence
- 50% confidence
- Finding
- Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.
