File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ func containsUntrustedContextPattern(variable string) bool {
3535			`issue\.body|`  + 
3636			`pull_request\.title|`  + 
3737			`pull_request\.body|`  + 
38+ 			`labels\.[^.]+\.name|`  + 
3839			`comment\.body|`  + 
3940			`review\.body|`  + 
4041			`review_comment\.body|`  + 
Original file line number Diff line number Diff line change @@ -86,6 +86,16 @@ func TestUntrustedContextVariables(t *testing.T) {
8686			variable : "github.event.commits[2].author.email" ,
8787			expected : true ,
8888		},
89+ 		{
90+ 			name :     "PR label name" ,
91+ 			variable : "github.event.pull_request.labels.foo.name" ,
92+ 			expected : true ,
93+ 		},
94+ 		{
95+ 			name :     "PR label wildcard name" ,
96+ 			variable : "github.event.pull_request.labels.*.name" ,
97+ 			expected : true ,
98+ 		},
8999	}
90100	for  _ , tt  :=  range  tests  {
91101		t .Run (tt .name , func (t  * testing.T ) {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments