Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ Airflow 2.5.0 (2022-12-02)
Significant Changes
^^^^^^^^^^^^^^^^^^^

``allowed_deserialization_classes`` restrict what classed might be used in XCom
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

In order to improve security of Airflow, only allowed classes can be used to pass data via
XCom. The administrators of Airflow should add all such classes to the allowed list of classes
in ``allowed_deserialization_classes`` in ``core`` section of Airflow configuration.


``airflow dags test`` no longer performs a backfill job (#26400)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
6 changes: 5 additions & 1 deletion airflow/utils/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ def object_hook(self, dct: dict) -> object:
break

if not cls:
raise ImportError(f"{classname} was not found in allow list for import")
raise ImportError(
f"{classname} was not found in allow list for import in XCom. "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f"{classname} was not found in allow list for import in XCom. "
f"{classname} was not found in allow list for imports. "

"If you want to continue to use your class in XCom, add it to "
"allowed_deserialization_classes config in core section of config."
Copy link
Member

@kaxil kaxil Dec 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"allowed_deserialization_classes config in core section of config."
"allowed_deserialization_classes config in core section of airflow.cfg."

)

if hasattr(cls, "deserialize"):
return getattr(cls, "deserialize")(dct[DATA], dct[VERSION])
Expand Down