Repository navigation
[iast] Validate meta_struct IAST payloads in the vulnerability schema test (APPSEC-71866) - #8592
Merged
avara1986 merged 2 commits intoNov 19, 2026
Conversation
…ma test (APPSEC-71866) TestIastVulnerabilitySchema only read meta["_dd.iast.json"]. Python sends the IAST data in meta_struct["iast"], so the test never validated a Python payload and did not catch UNTRUSTED_SERIALIZATION (APPSEC-71849). Validate meta_struct["iast"] too, and declare the test as a bug for the Python versions that report UNTRUSTED_SERIALIZATION (3.15.0 up to 4.18.0rc1), except aiohttp and tornado, which do not report it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
|
🎉 All green!🧪 All tests passed 🔗 Commit SHA: c285411 | Docs | View more details | Give us feedback! |
…st' into alberto.vara/iast-schema-validate-meta-struct
avara1986
marked this pull request as ready for review
November 19, 2026 13:53
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
christophe-papazian
approved these changes
Nov 19, 2026
avara1986
merged commit Nov 19, 2026
d79d9ae
into
alberto.vara/enable-python-untrusted-deserialization-iast
926 of 928 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
APPSEC-71866:
TestIastVulnerabilitySchemaonly validatesmeta["_dd.iast.json"]. Since dd-trace-py 3.11.0, Python sends IAST data only inmeta_struct["iast"], so the test has not validated a Python payload since then. That is why it did not catch APPSEC-71849: Python reported untrusted deserialization (a sink added in 3.15.0) asUNTRUSTED_SERIALIZATION, a type that is not in the schema..NET has the same gap: from 3.7.0, it sends IAST data in
meta_struct["iast"]when the agent supports it, which is the case in system-tests.Stacked on #8585, which adds the Python untrusted deserialization endpoints that produce those findings.
Where each tracer sends the IAST data
The Security events in meta struct RFC moves the IAST data from the
_dd.iast.jsontag tometa_struct["iast"]when the agent reportsspan_meta_structsin/info, with_dd.iast.jsonas the fallback. A tracer sends one or the other, never both. Sources: the RFC status table, the tracers' code, and the declarations oftests/appsec/test_metastruct.py.meta_structmeta_struct["iast"]only_dd.iast.jsonmeta_struct["iast"]_dd.iast.json_dd.iast.json(itsmeta_structtests aremissing_feature, APPSEC-4766)_dd.iast.json(missing_feature)_dd.iast.json(missing_feature)In Python, the choice is
_use_metastruct_for_iast = True, hardcoded inddtrace/internal/settings/asm.py. It is not read from an environment variable and does not depend on the agent; only unit tests override it. In the local runs below, the agent forwards the Python report to the backend as theiaststruct attribute: no payload contains_dd.iast.json, neither from the tracer nor from the agent.Changes
TestIastVulnerabilitySchemavalidatesmeta_struct["iast"]too. A failure now shows the field, the span and the error messages.manifests/python.yml: the test is declaredbug (APPSEC-71849)from 3.15.0 (the first release with the sink) to before 4.18.0rc1, except on aiohttp and tornado. These two weblogs do not report the finding: tornado has no untrusted deserialization endpoint, and aiohttp has no IAST before 4.18.v3.8.0.devbecomes the equivalentmissing_featurebelow 3.8.0-dev.Local results (Python)
DEFAULT scenario, all of
tests/appsec/iast. I also validated every captured payload against the schema outside the test.UNTRUSTED_SERIALIZATION). The test xfails withbug (APPSEC-71849)The only invalid Python payloads are the untrusted deserialization findings of the versions before the fix. For django-poc and fastapi on 4.17.1, the manifest evaluates to
bug (APPSEC-71849), the same as for flask-poc. The re-run that confirmed the xfail used flask-poc.Follow-up
The 4.17, 4.16 and 3.19 backports of DataDog/dd-trace-py#21896 and DataDog/dd-trace-py#21918 have not shipped yet. When they ship, the
bugrange must stop at the first fixed patch version of each line, like the declarations of #8585.🤖 Generated with Claude Code