Skip to content

Java - Taint propagation across visitor pattern + lambdas #15992

@chmodxxx

Description

@chmodxxx

Hello,

I'm dealing with this flow in java which includes the following code :


    @Override
    public void doSomething(SourceType source, Optional<Scope> maybeScope) {
        maybeScope.ifPresentOrElse(
                scope -> scope.accept(Scope.Visitor.<Void>builder()
                        .something(somethingScope -> {
                            sink1(source, somethingScope.getId());
                            return null;
                        })
                        .throwOnUnknown()
                        .build()),
                () -> sink2(source));
    }

This code doesn't propagate source to sink1.

I have confirmed that data flows through ifPresentOrElse, I think data is not flowing when we deal with visitors + lambdas .
Please correct me if i'm wrong

Metadata

Metadata

Assignees

No one assigned

    Labels

    JavaquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions