Repository navigation
AsyncAPI 3.x: taint the payloads of AsyncAPI messages - #1870
Open
LautaroPetaccio wants to merge 1 commit into
Open
LautaroPetaccio wants to merge 1 commit into
LautaroPetaccio wants to merge 1 commit into
Conversation
REST, GraphQL, RPC and Web all run taint analysis in white-box mode: a string gene carries a recognisable tainted value, the instrumented SUT reports what it compared that value with, and the gene learns the constant for mutation to use. AsyncAPI never did, so a service that branches on a payload field equal to some constant left the search guessing. Nothing else was missing. Payload and header strings are StringGenes that already take tainted values at sampling and mutation time, they travel to the service inside the message, the instrumentation reports what it saw regardless of the problem type, and the controller records one AdditionalInfo entry per action it is told about. So AsyncApiFitness calls TaintAnalysis.doTaintAnalysis after reading the coverage, under the same conditions as REST and GraphQL: white-box, during the search, with taint analysis enabled, which it is by default. Worth flagging for review: - The size check is against the call results, not the equality GraphQL asserts: no more entries than AsyncApiCallResults. A test stops at the first message that could not be published, so there can be fewer results than actions, and a driver that could not be reached records no entry for its message, so there can be fewer entries than results. TaintAnalysis itself only refuses more. - The action index in the instrumentation is global, so a comparison made on a consumer thread is recorded against whichever action is current. This is harmless: the analysis matches each reported value against the genes of every action. AsyncApiFitnessTest covers a payload string gaining the constant from the AdditionalInfoDto a fake driver reports, a test stopped by a failed publish with fewer entries than actions, a black-box run under MIO (where taint analysis is enabled) that never asks for coverage and so never analyses, and an evaluation outside the search that does not analyse either. Black-box runs are unchanged, as are all other problem types.
LautaroPetaccio
force-pushed
the
feature/asyncapi-taint
branch
from
October 12, 2026 02:54
beabb70 to
9e28a78
Compare
jgaleotti
approved these changes
Oct 13, 2026
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.
Third in the AsyncAPI white-box stack, on top of #1869. White-box AsyncAPI runs use taint analysis, on by default as it is for REST, GraphQL, RPC and Web runs.
Why
Taint analysis is how the search learns the constants a service compares its inputs with: a string gene carries a recognisable value, the instrumented SUT reports what it compared that value with, and the gene keeps the constant for mutation to use.
AsyncApiFitnessnever ran it, so a service that branches on a payload field equal to some constant left the search guessing.What it adds
One call in
AsyncApiFitness:TaintAnalysis.doTaintAnalysisafter the coverage is read, under the same conditions as REST and GraphQL: white-box (after #1869, the only mode that reads coverage), during the search, and with taint analysis enabled.Nothing else was missing:
StringGenes, which already take tainted values at sampling and mutation time;AdditionalInfoentry per action it is told about, sinceEMController.newActionsets the action before branching on the call type.Two things that are less obvious than they look
additionalInfoListmay have no more entries than there areAsyncApiCallResults. A test stops at the first message that could not be published, so there can be fewer results than actions, and a driver that could not be reached records no entry for its message, so there can be fewer entries than results.TaintAnalysisitself only refuses more.Not here
An E2E that shows taint reaching a branch only it can reach needs a SUT that compares a payload field with a constant. It comes with the fire-and-forget Spring Kafka E2E later in the stack.
Testing
AsyncApiFitnessTest, 4 new tests:AdditionalInfoDtoaFakeAsyncApiDriverreports, and the tainted value is in the payload the driver was asked to publish;--algorithm MIO, where taint analysis is enabled, never asks for coverage and so never analyses;NcsKafkaEMTest(Docker): 3 tests, 0 failures.StatisticsTest: 291 tests, 0 failures.