bugraoz93 commented on code in PR #64618:
URL: https://github.com/apache/airflow/pull/64618#discussion_r3047143805


##########
airflow-ctl/src/airflowctl/api/client.py:
##########
@@ -143,6 +145,23 @@ def _bounded_get_new_password() -> str:
     )
 
 
+_VALID_ENV_RE = re.compile(r"^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$")

Review Comment:
   I think we shouldn't use any regexp match as it not needed. The below one 
you added thouls be enough to prevent `../` relative paths. Regexp seems an 
additional check which can be also limiting while trying to prevent what we 
already doing below
   
   ```
   def _safe_path_under_airflow_home(airflow_home: str, filename: str) -> str:
       base = Path(airflow_home).resolve()
       target = (base / filename).resolve()
       if base not in target.parents and target != base:
           raise ValueError(f"Resolved path escapes AIRFLOW_HOME: {target}")
       return str(target)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to