Skip to content

Commit

Permalink
Do not show version/node in UI traceback for unauthenticated user (#2…
Browse files Browse the repository at this point in the history
…9501)

The traceback contains information that might be useful for a potential
attacker to better target their attack (Python/Airflow version, node
name). This information should not be shown if traceback is shown to
unauthenticated user.

(cherry picked from commit cf81455)
  • Loading branch information
potiuk authored and pierrejeambrun committed Mar 8, 2023
1 parent c439634 commit 965e76d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,13 @@ def show_traceback(error):
return (
render_template(
"airflow/traceback.html",
python_version=sys.version.split(" ")[0],
airflow_version=version,
python_version=sys.version.split(" ")[0] if g.user.is_authenticated else "redact",
airflow_version=version if g.user.is_authenticated else "redact",
hostname=get_hostname()
if conf.getboolean("webserver", "EXPOSE_HOSTNAME", fallback=True)
if conf.getboolean("webserver", "EXPOSE_HOSTNAME", fallback=True) and g.user.is_authenticated
else "redact",
info=traceback.format_exc()
if conf.getboolean("webserver", "EXPOSE_STACKTRACE", fallback=True)
if conf.getboolean("webserver", "EXPOSE_STACKTRACE", fallback=True) and g.user.is_authenticated
else "Error! Please contact server admin.",
),
500,
Expand Down

0 comments on commit 965e76d

Please sign in to comment.