Class HardenXMLDecoderCodemod

java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.expr.ObjectCreationExpr>
io.codemodder.codemods.HardenXMLDecoderCodemod
All Implemented Interfaces:
io.codemodder.CodeChanger

@Codemod(id="pixee:java/harden-xmldecoder-stream", reviewGuidance=MERGE_WITHOUT_REVIEW) public final class HardenXMLDecoderCodemod extends io.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.expr.ObjectCreationExpr>
Adds gadget filtering logic to XMLDecoder streams.
  • Field Summary

    Fields inherited from class io.codemodder.SarifPluginJavaParserChanger

    sarif

    Fields inherited from class io.codemodder.javaparser.JavaParserChanger

    reporter
  • Constructor Summary

    Constructors
    Constructor
    Description
    HardenXMLDecoderCodemod(io.codemodder.RuleSarif sarif)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<io.codemodder.DependencyGAV>
     
    boolean
    onResultFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.ObjectCreationExpr newXmlDecoderCall, com.contrastsecurity.sarif.Result result)
     

    Methods inherited from class io.codemodder.SarifPluginJavaParserChanger

    visit

    Methods inherited from class io.codemodder.javaparser.JavaParserChanger

    getDescription, getIndividualChangeDescription, getReferences, getSummary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HardenXMLDecoderCodemod

      @Inject public HardenXMLDecoderCodemod(@SemgrepScan(ruleId="harden-xmldecoder-stream") io.codemodder.RuleSarif sarif)
  • Method Details

    • onResultFound

      public boolean onResultFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.ObjectCreationExpr newXmlDecoderCall, com.contrastsecurity.sarif.Result result)
      Specified by:
      onResultFound in class io.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.expr.ObjectCreationExpr>
    • dependenciesRequired

      public List<io.codemodder.DependencyGAV> dependenciesRequired()
      Overrides:
      dependenciesRequired in class io.codemodder.javaparser.JavaParserChanger