Build 8 success

gitbay-security on main · dc13e71657 · queued 2026-11-08 04:00 UTC · finished 2026-11-08 04:53 UTC · ran 1m45s

setup
$ git clone ssh://git@127.0.0.1/krz/orgstar.git (dc13e71657)
step 1/2 mkdir -p "$GITBAY_RESULTS"

step 2/2 opengrep scan --quiet --disable-version-check --config /opt/opengrep-rules --sarif-output="$GITBAY_RESULTS/opengrep.sarif" .
                    
                    
┌──────────────────┐
│ 32 Code Findings │
└──────────────────┘
                                                   
    Sources/TreeSitterElisp/src/tree_sitter/array.h
    ❯❱ opt.opengrep-rules.c.lang.security.insecure-use-memset
          When handling sensitive information in a buffer, it's important to ensure  that the data is securely
          erased before the buffer is deleted or reused.  While `memset()` is commonly used for this purpose, 
          it can leave sensitive  information behind due to compiler optimizations or other factors.  To avoid
          this potential vulnerability, it's recommended to use the  `memset_s()` function instead.           
          `memset_s()` is a standardized function  that securely overwrites the memory with a specified value,
          making it more  difficult for an attacker to recover any sensitive data that was stored in  the     
          buffer. By using `memset_s()` instead of `memset()`, you can help to  ensure that your application  
          is more secure and less vulnerable to exploits  that rely on residual data in memory.               
                                                                                                              
           ▶▶┆ Autofix ▶ memset_s(contents + index * element_size), 0, new_count * element_size)
          246┆ memset(
          247┆   (contents + index * element_size),
          248┆   0,
          249┆   new_count * element_size
          250┆ );
                                                             
    Sources/TreeSitterScanners/javascript/tree_sitter/array.h
    ❯❱ opt.opengrep-rules.c.lang.security.insecure-use-memset
          When handling sensitive information in a buffer, it's important to ensure  that the data is securely
          erased before the buffer is deleted or reused.  While `memset()` is commonly used for this purpose, 
          it can leave sensitive  information behind due to compiler optimizations or other factors.  To avoid
          this potential vulnerability, it's recommended to use the  `memset_s()` function instead.           
          `memset_s()` is a standardized function  that securely overwrites the memory with a specified value,
          making it more  difficult for an attacker to recover any sensitive data that was stored in  the     
          buffer. By using `memset_s()` instead of `memset()`, you can help to  ensure that your application  
          is more secure and less vulnerable to exploits  that rely on residual data in memory.               
                                                                                                              
           ▶▶┆ Autofix ▶ memset_s(contents + index * element_size), 0, new_count * element_size)
          246┆ memset(
          247┆   (contents + index * element_size),
          248┆   0,
          249┆   new_count * element_size
          250┆ );
                                                      
    Sources/TreeSitterScanners/lua/tree_sitter/array.h
    ❯❱ opt.opengrep-rules.c.lang.security.insecure-use-memset
          When handling sensitive information in a buffer, it's important to ensure  that the data is securely
          erased before the buffer is deleted or reused.  While `memset()` is commonly used for this purpose, 
          it can leave sensitive  information behind due to compiler optimizations or other factors.  To avoid
          this potential vulnerability, it's recommended to use the  `memset_s()` function instead.           
          `memset_s()` is a standardized function  that securely overwrites the memory with a specified value,
          making it more  difficult for an attacker to recover any sensitive data that was stored in  the     
          buffer. By using `memset_s()` instead of `memset()`, you can help to  ensure that your application  
          is more secure and less vulnerable to exploits  that rely on residual data in memory.               
                                                                                                              
           ▶▶┆ Autofix ▶ memset_s(contents + index * element_size), 0, new_count * element_size)
          283┆ memset(
          284┆   (contents + index * element_size),
          285┆   0,
          286┆   new_count * element_size
          287┆ );
                                                         
    Sources/TreeSitterScanners/python/tree_sitter/array.h
    ❯❱ opt.opengrep-rules.c.lang.security.insecure-use-memset
          When handling sensitive information in a buffer, it's important to ensure  that the data is securely
          erased before the buffer is deleted or reused.  While `memset()` is commonly used for this purpose, 
          it can leave sensitive  information behind due to compiler optimizations or other factors.  To avoid
          this potential vulnerability, it's recommended to use the  `memset_s()` function instead.           
          `memset_s()` is a standardized function  that securely overwrites the memory with a specified value,
          making it more  difficult for an attacker to recover any sensitive data that was stored in  the     
          buffer. By using `memset_s()` instead of `memset()`, you can help to  ensure that your application  
          is more secure and less vulnerable to exploits  that rely on residual data in memory.               
                                                                                                              
           ▶▶┆ Autofix ▶ memset_s(contents + index * element_size), 0, new_count * element_size)
          246┆ memset(
          247┆   (contents + index * element_size),
          248┆   0,
          249┆   new_count * element_size
          250┆ );
                                                       
    Sources/TreeSitterScanners/yaml/tree_sitter/array.h
    ❯❱ opt.opengrep-rules.c.lang.security.insecure-use-memset
          When handling sensitive information in a buffer, it's important to ensure  that the data is securely
          erased before the buffer is deleted or reused.  While `memset()` is commonly used for this purpose, 
          it can leave sensitive  information behind due to compiler optimizations or other factors.  To avoid
          this potential vulnerability, it's recommended to use the  `memset_s()` function instead.           
          `memset_s()` is a standardized function  that securely overwrites the memory with a specified value,
          making it more  difficult for an attacker to recover any sensitive data that was stored in  the     
          buffer. By using `memset_s()` instead of `memset()`, you can help to  ensure that your application  
          is more secure and less vulnerable to exploits  that rely on residual data in memory.               
                                                                                                              
           ▶▶┆ Autofix ▶ memset_s(contents + index * element_size), 0, new_count * element_size)
          246┆ memset(
          247┆   (contents + index * element_size),
          248┆   0,
          249┆   new_count * element_size
          250┆ );
                                      
    Tests/OrgCoreTests/CalcTests.swift
    ❯❱ opt.opengrep-rules.swift.lang.crypto.insecure-random
          A random number generator was detected which is **not** *guaranteed* to be Cryptographically secure.
          If the source of entropy is used for security purposes (e.g. with other Cryptographic operations),  
          make sure to use the `SecCopyRandomBytes` API explicitly.                                           
                                                                                                              
           74┆ var generator = SystemRandomNumberGenerator()
            ⋮┆----------------------------------------
           79┆ for _ in 0..<Int.random(in: 1...4, using: &generator) {
                                             
    Tests/OrgCoreTests/IncrementalTests.swift
    ❯❱ opt.opengrep-rules.swift.lang.crypto.insecure-random
          A random number generator was detected which is **not** *guaranteed* to be Cryptographically secure.
          If the source of entropy is used for security purposes (e.g. with other Cryptographic operations),  
          make sure to use the `SecCopyRandomBytes` API explicitly.                                           
                                                                                                              
          103┆ let b = Bool.random(using: &rng) ? a : later.randomElement(using: &rng)!
            ⋮┆----------------------------------------
          105┆ if Int.random(in: 0..<10, using: &rng) < 7 {
            ⋮┆----------------------------------------
          106┆ replacement = (0..<Int.random(in: 0...2, using: &rng)).map { _ in
               small.randomElement(using: &rng)! }.joined()                     
            ⋮┆----------------------------------------
          108┆ replacement = fragments.randomElement(using: &rng)! + (Bool.random(using: &rng) ? "\n" :
               "")                                                                                     
                                              
    Tests/OrgCoreTests/ListItemScanTests.swift
    ❯❱ opt.opengrep-rules.swift.lang.crypto.insecure-random
          A random number generator was detected which is **not** *guaranteed* to be Cryptographically secure.
          If the source of entropy is used for security purposes (e.g. with other Cryptographic operations),  
          make sure to use the `SecCopyRandomBytes` API explicitly.                                           
                                                                                                              
           11┆ var generator = SystemRandomNumberGenerator()
            ⋮┆----------------------------------------
           15┆ let count = Int.random(in: 1...7, using: &generator)
                                           
    Tests/OrgCoreTests/RoundTripTests.swift
    ❯❱ opt.opengrep-rules.swift.lang.crypto.insecure-random
          A random number generator was detected which is **not** *guaranteed* to be Cryptographically secure.
          If the source of entropy is used for security purposes (e.g. with other Cryptographic operations),  
          make sure to use the `SecCopyRandomBytes` API explicitly.                                           
                                                                                                              
           32┆ (0..<Int.random(in: 0...40, using: &rng)).map { _ in
            ⋮┆----------------------------------------
           33┆ fragments.randomElement(using: &rng)! + (Bool.random(using: &rng) ? "\n" : "")
                                                   
    Tests/OrgEditorAppKitTests/LineIndexTests.swift
    ❯❱ opt.opengrep-rules.swift.lang.crypto.insecure-random
          A random number generator was detected which is **not** *guaranteed* to be Cryptographically secure.
          If the source of entropy is used for security purposes (e.g. with other Cryptographic operations),  
          make sure to use the `SecCopyRandomBytes` API explicitly.                                           
                                                                                                              
           14┆ var generator = SystemRandomNumberGenerator()
            ⋮┆----------------------------------------
           20┆ let start = Int.random(in: 0...ns.length, using: &generator)
            ⋮┆----------------------------------------
           37┆ var generator = SystemRandomNumberGenerator()
            ⋮┆----------------------------------------
           42┆ let start = Int.random(in: 0...length, using: &generator)
                                   
    docs/manual/templates/base.html
    ❯❱ opt.opengrep-rules.generic.html-templates.security.var-in-href
          Detected a template variable used in an anchor tag with the 'href' attribute. This allows a       
          malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS)      
          attacks. If using Flask, use 'url_for()' to safely generate a URL. If using Django, use the 'url' 
          filter to safely generate a URL. If using Mustache, use a URL encoding library, or prepend a slash
          '/' to the variable for relative links (`href="/{{link}}"`). You may also consider setting the    
          Content Security Policy (CSP) header.                                                             
                                                                                                            
           26┆ <a href="{{ item.url }}">{{ item.title }}</a>
   
    ❯❱ opt.opengrep-rules.python.flask.security.xss.audit.template-unescaped-with-safe
          Detected a segment of a Flask template where autoescaping is explicitly disabled with '| safe'  
          filter. This allows rendering of raw HTML in this segment. Ensure no user data is rendered here,
          otherwise this is a cross-site scripting (XSS) vulnerability.                                   
                                                                                                          
           50┆ {% block content %}{{ body | safe }}{% endblock %}</main>
                                   
    docs/manual/templates/list.html
    ❯❱ opt.opengrep-rules.generic.html-templates.security.var-in-href
          Detected a template variable used in an anchor tag with the 'href' attribute. This allows a       
          malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS)      
          attacks. If using Flask, use 'url_for()' to safely generate a URL. If using Django, use the 'url' 
          filter to safely generate a URL. If using Mustache, use a URL encoding library, or prepend a slash
          '/' to the variable for relative links (`href="/{{link}}"`). You may also consider setting the    
          Content Security Policy (CSP) header.                                                             
                                                                                                            
            6┆ <a href="{{ root }}{{ entry.url }}">{{ entry.title }}</a>
                        
    scripts/build-app.sh
     ❱ opt.opengrep-rules.bash.lang.correctness.unquoted-variable-expansion-in-command
          Variable expansions must be double-quoted so as to prevent being split into multiple pieces        
          according to whitespace or whichever separator is specified by the IFS variable. If you really wish
          to split the variable's contents, you may use a variable that starts with an underscore e.g. $_X   
          instead of $X, and semgrep will ignore it. If what you need is an array, consider using a proper   
          bash array.                                                                                        
                                                                                                             
           24┆ swift build -c release $arch_flags --product Orgstar
            ⋮┆----------------------------------------
           26┆ swift build -c release $arch_flags --product OrgstarQuickLook
            ⋮┆----------------------------------------
           28┆ swift build -c release $arch_flags --product OrgstarSpotlight
            ⋮┆----------------------------------------
           30┆ swift build -c release $arch_flags --product OrgstarWidgets
            ⋮┆----------------------------------------
           32┆ binary="$(swift build -c release $arch_flags --show-bin-path)/Orgstar"
            ⋮┆----------------------------------------
          220┆ codesign --force --sign "$sign" $sign_flags --entitlements "$work/sandbox.entitlements"
               "$app/Contents/PlugIns/$1.appex"                                                       
            ⋮┆----------------------------------------
          236┆ codesign --force --sign "$sign" $sign_flags "$item"
            ⋮┆----------------------------------------
          251┆ codesign --force --sign "$sign" $sign_flags --entitlements "$work/app.entitlements" "$app"
                            
    scripts/build-ios-app.sh
     ❱ opt.opengrep-rules.bash.lang.correctness.unquoted-variable-expansion-in-command
          Variable expansions must be double-quoted so as to prevent being split into multiple pieces        
          according to whitespace or whichever separator is specified by the IFS variable. If you really wish
          to split the variable's contents, you may use a variable that starts with an underscore e.g. $_X   
          instead of $X, and semgrep will ignore it. If what you need is an array, consider using a proper   
          bash array.                                                                                        
                                                                                                             
          172┆ codesign --force --sign - ${6:+--entitlements "$6"} "$dir"
                           
    scripts/sync-strings.sh
     ❱ opt.opengrep-rules.bash.lang.correctness.unquoted-command-substitution-in-command
          The result of command substitution $(...) or `...`, if unquoted, is split on whitespace or other
          separators specified by the IFS variable. You should surround it with double quotes to avoid    
          splitting the result.                                                                           
                                                                                                          
           27┆ xcrun xcstringstool sync "$catalog" --stringsdata $(tr '\n' ' ' < "$mac/stringsdata.txt")

results uploaded