Skip to content

fix: keep explicit dataflow values when check() applies defaults - #374

Open
Svastikkka wants to merge 1 commit into
OWASP:masterfrom
Svastikkka:fix/373-tm-check-overwrites-explicit-dataflow-pr
Open

Svastikkka wants to merge 1 commit into
OWASP:masterfrom
Svastikkka:fix/373-tm-check-overwrites-explicit-dataflow-pr

Conversation

@Svastikkka

Copy link
Copy Markdown

Fixes #373

Since the move to Pydantic, TM.check() overwrote a dataflow's explicitly set protocol, ports and encryption flag with the sink's or source's defaults, so threats were evaluated against the wrong values.

Defaults are now only filled in when the model didn't set the field (model_fields_set), for both request and response flows, which brings back the 1.3.1 behaviour.

Testing:

  • Added a regression test that explicit values survive check().
  • Full test suite passes.
  • The reproduction from the issue now prints 'HTTPS' 443 True and the same findings as 1.3.1.

@Svastikkka
Svastikkka force-pushed the fix/373-tm-check-overwrites-explicit-dataflow-pr branch from 3f186a6 to 7c7eb83 Compare October 29, 2026 05:21
@Svastikkka
Svastikkka marked this pull request as ready for review October 29, 2026 05:34
@Svastikkka
Svastikkka requested a review from izar as a code owner October 29, 2026 05:34
@izar izar self-assigned this Oct 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TM.check() overwrites explicit Dataflow protocol, dstPort and controls.isEncrypted with sink defaults (regression in 1.4.0)

2 participants