You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2026/05/07 00:22:08 UTC

[PR] Tighten deserialization allowlist regex to require full-string match [airflow]

potiuk opened a new pull request, #66499:
URL: https://github.com/apache/airflow/pull/66499

   Tighten the deserialization allowlist (`[core] allowed_deserialization_classes_regexp`)
   to use `re.fullmatch()` instead of `re.match()`. Previously a pattern such as
   `airflow\.models\.Variable` admitted not only the intended class but also
   `airflow.models.Variable_Malicious` — `re.match` only anchors at the start
   of the string. Using `fullmatch` requires the pattern to match the entire
   classname, eliminating the prefix-bypass footgun.
   
   Updated the config description so admins know patterns are full-match and
   that `.*` is needed for prefix-style allowances. Updated the existing test
   that relied on prefix-match semantics, and added a dedicated test for the
   bypass scenario.
   
   ##### Compatibility note for reviewers
   
   This is a behaviour change for any deployment that configured
   `allowed_deserialization_classes_regexp` with patterns relying on
   prefix-match semantics (e.g. `airflow\.models\.` to mean "any class under
   `airflow.models`"). Such deployments need to add `.*` to the pattern.
   The default value is empty, so out-of-the-box deployments are unaffected.
   Default off, admin-only config — leaving the newsfragment decision to the
   reviewer.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Opus 4.7 (1M context)
   
   Generated-by: Claude Opus 4.7 (1M context) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Tighten deserialization allowlist regex to require full-string match [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #66499:
URL: https://github.com/apache/airflow/pull/66499#issuecomment-4476163790

   ### Backport successfully created: v3-2-test
   
   Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
   the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.
   
   In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
   
   <table>
           <tr>
           <th>Status</th>
           <th>Branch</th>
           <th>Result</th>
       </tr>
       <tr>
           <td>✅</td>
           <td>v3-2-test</td>
           <td><a href="https://github.com/apache/airflow/pull/67096"><img src="https://img.shields.io/badge/PR-67096-blue" alt="PR Link"></a></td>
       </tr>
   </table>


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Tighten deserialization allowlist regex to require full-string match [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #66499:
URL: https://github.com/apache/airflow/pull/66499#issuecomment-4472300741

   I'd love to get this one merged — and would love it in 3.2.2 if it's not too late. cc @vatsrahul1001 (3.2.2 RM)
   
   ---
   Drafted-by: Claude Code (Opus 4.7); reviewed by @potiuk before posting


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Tighten deserialization allowlist regex to require full-string match [airflow]

Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 merged PR #66499:
URL: https://github.com/apache/airflow/pull/66499


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Tighten deserialization allowlist regex to require full-string match [airflow]

Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 commented on PR #66499:
URL: https://github.com/apache/airflow/pull/66499#issuecomment-4474343766

   LGTM!, need love to get another pair of eyes @amoghrajesh @kaxil @ashb 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org