@@ -38,7 +38,8 @@ type Analyzer struct {
3838 oastProvider OASTProvider
3939 logger * zap.Logger
4040 activeProbes map [string ]ActiveProbe
41- probesMutex sync.RWMex
41+ // FIX: This was a typo, changed RWMex to RWMutex.
42+ probesMutex sync.RWMutex
4243 eventsChan chan Event
4344 wg sync.WaitGroup
4445 producersWG sync.WaitGroup
@@ -268,7 +269,8 @@ func (a *Analyzer) generateCanary(prefix string, probeType schemas.ProbeType) st
268269}
269270
270271// preparePayload replaces placeholders (Canary, OASTServer) in the probe definition.
271- func (a * Analyzer ) preparePayload (probeDef schemas.ProbeDefinition , canary string ) string {
272+ // FIX: Changed schemas.ProbeDefinition to the local ProbeDefinition type.
273+ func (a * Analyzer ) preparePayload (probeDef ProbeDefinition , canary string ) string {
272274 requiresOAST := strings .Contains (probeDef .Payload , "{{.OASTServer}}" )
273275 if requiresOAST && a .oastProvider == nil {
274276 a .logger .Warn ("OAST probe defined but no OAST provider configured. Skipping probe." , zap .String ("canary" , canary ))
@@ -604,7 +606,7 @@ func (a *Analyzer) processOASTInteraction(interaction OASTInteraction) {
604606 Probe : probe ,
605607 Detail : detail ,
606608 IsConfirmed : true ,
607- SanitizationLevel : schemas . SanitizationNone ,
609+ SanitizationLevel : SanitizationNone ,
608610 StackTrace : "N/A (Out of Band)" ,
609611 OASTDetails : & interaction ,
610612 }
@@ -645,7 +647,7 @@ func (a *Analyzer) processExecutionProof(proof ExecutionProofEvent) {
645647 Probe : probe ,
646648 Detail : "Payload execution confirmed via JS callback." ,
647649 IsConfirmed : true ,
648- SanitizationLevel : schemas . SanitizationNone ,
650+ SanitizationLevel : SanitizationNone ,
649651 StackTrace : proof .StackTrace ,
650652 }
651653 a .reporter .Report (finding )
@@ -737,7 +739,7 @@ func (a *Analyzer) processPrototypePollutionConfirmation(event SinkEvent) {
737739 Probe : probe ,
738740 Detail : fmt .Sprintf ("Successfully polluted Object.prototype property: %s" , event .Detail ),
739741 IsConfirmed : true ,
740- SanitizationLevel : schemas . SanitizationNone ,
742+ SanitizationLevel : SanitizationNone ,
741743 StackTrace : event .StackTrace ,
742744 }
743745 a .reporter .Report (finding )
@@ -779,39 +781,44 @@ var ValidTaintFlows = map[TaintFlowPath]bool{
779781
780782 {schemas .ProbeTypeGeneric , schemas .SinkWebSocketSend }: true ,
781783 {schemas .ProbeTypeGeneric , schemas .SinkXMLHTTPRequest }: true ,
782- {schemas .ProbeTypeGeneric , schemas .SinkXMLHTTPRequest_URL }: true ,
784+ // FIX: The constant name was incorrect (had a trailing underscore).
785+ {schemas .ProbeTypeGeneric , schemas .SinkXMLHTTPRequestURL }: true ,
783786 {schemas .ProbeTypeGeneric , schemas .SinkFetch }: true ,
784- {schemas .ProbeTypeGeneric , schemas .SinkFetch_URL }: true ,
787+ // FIX: The constant name was incorrect (had a trailing underscore).
788+ {schemas .ProbeTypeGeneric , schemas .SinkFetchURL }: true ,
785789 {schemas .ProbeTypeGeneric , schemas .SinkNavigation }: true ,
786790 {schemas .ProbeTypeGeneric , schemas .SinkSendBeacon }: true ,
787791 {schemas .ProbeTypeGeneric , schemas .SinkWorkerSrc }: true ,
788792
789793 {schemas .ProbeTypeOAST , schemas .SinkWebSocketSend }: true ,
790794 {schemas .ProbeTypeOAST , schemas .SinkXMLHTTPRequest }: true ,
791- {schemas .ProbeTypeOAST , schemas .SinkXMLHTTPRequest_URL }: true ,
795+ // FIX: The constant name was incorrect (had a trailing underscore).
796+ {schemas .ProbeTypeOAST , schemas .SinkXMLHTTPRequestURL }: true ,
792797 {schemas .ProbeTypeOAST , schemas .SinkFetch }: true ,
793- {schemas .ProbeTypeOAST , schemas .SinkFetch_URL }: true ,
798+ // FIX: The constant name was incorrect (had a trailing underscore).
799+ {schemas .ProbeTypeOAST , schemas .SinkFetchURL }: true ,
794800 {schemas .ProbeTypeOAST , schemas .SinkNavigation }: true ,
795801 {schemas .ProbeTypeOAST , schemas .SinkSendBeacon }: true ,
796802 {schemas .ProbeTypeOAST , schemas .SinkWorkerSrc }: true ,
797803}
798804
799805// checkSanitization compares the sink value with the original probe payload.
800- func (a * Analyzer ) checkSanitization (sinkValue string , probe ActiveProbe ) (schemas.SanitizationLevel , string ) {
806+ // FIX: Changed schemas.SanitizationLevel to the local SanitizationLevel type.
807+ func (a * Analyzer ) checkSanitization (sinkValue string , probe ActiveProbe ) (SanitizationLevel , string ) {
801808 if strings .Contains (sinkValue , probe .Value ) {
802- return schemas . SanitizationNone , ""
809+ return SanitizationNone , ""
803810 }
804811
805812 if probe .Type == schemas .ProbeTypeXSS || probe .Type == schemas .ProbeTypeSSTI {
806813 if ! strings .Contains (sinkValue , "<" ) && ! strings .Contains (sinkValue , ">" ) && (strings .Contains (probe .Value , "<" ) || strings .Contains (probe .Value , ">" )) {
807- return schemas . SanitizationPartial , " (Potential Sanitization: HTML tags modified or stripped)"
814+ return SanitizationPartial , " (Potential Sanitization: HTML tags modified or stripped)"
808815 }
809816 if (strings .Contains (sinkValue , "\\ \" " ) || strings .Contains (sinkValue , """ )) && ! strings .Contains (probe .Value , "\\ \" " ) && ! strings .Contains (probe .Value , """ ) {
810- return schemas . SanitizationPartial , " (Potential Sanitization: Quotes escaped)"
817+ return SanitizationPartial , " (Potential Sanitization: Quotes escaped)"
811818 }
812819 }
813820
814- return schemas . SanitizationPartial , " (Potential Sanitization: Payload modified)"
821+ return SanitizationPartial , " (Potential Sanitization: Payload modified)"
815822}
816823
817824// isContextValid implements the rules engine for reducing false positives.
0 commit comments