Build 10 success

gitbay-security on main · e9a14b1e88 · queued 2026-11-20 20:15 UTC · finished 2026-11-20 20:19 UTC · ran 1m54s

setup
$ git clone ssh://git@127.0.0.1/krz/orgstar.git (e9a14b1e88)
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" .
                    
                    
┌──────────────────┐
│ 61 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.                                           
                                                                                                              
          162┆ var generator = SystemRandomNumberGenerator()
            ⋮┆----------------------------------------
          167┆ for _ in 0..<Int.random(in: 1...4, using: &generator) {
            ⋮┆----------------------------------------
          187┆ var generator = SystemRandomNumberGenerator()
            ⋮┆----------------------------------------
          204┆ var generator = SystemRandomNumberGenerator()
            ⋮┆----------------------------------------
          222┆ let x = "\(Int.random(in: 1...999, using: &generator))e-2"
            ⋮┆----------------------------------------
          229┆ for _ in 0..<Int.random(in: 1...3, 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>
                                      
    packaging/license-issuer/worker.js
    ❯❱ opt.opengrep-rules.javascript.lang.correctness.no-stringify-keys
          JSON stringify does not produce a stable key ordering, and should not be relied on for producing
          object keys. Consider using json-stable-stringify instead.                                      
                                                                                                          
           43┆ if (!(value > 0)) throw new Error(`${name} must be a positive number, not
               ${JSON.stringify(env[name])}`);                                          
   
    ❯❱ opt.opengrep-rules.javascript.lang.security.html-in-template-string
          This template literal looks like HTML and has interpolated variables. These variables are not HTML-
          encoded by default. If the variables contain HTML tags, these may be interpreted by the browser,   
          resulting in cross-site scripting (XSS).                                                           
                                                                                                             
           66┆ const features = FEATURES.map((feature) => `<li>${feature}</li>`).join("");
            ⋮┆----------------------------------------
           69┆ `clocking, tables and search stay free.</p><ul>${features}</ul>` +
            ⋮┆----------------------------------------
           70┆ `<ul class="tiers"><li><b>$${lifetime} once</b>: a license key that doesn't expire.</li>` +
            ⋮┆----------------------------------------
           71┆ `<li><b>$${monthly} a month</b>: a key that orgstar renews while you sponsor.</li></ul>` +
            ⋮┆----------------------------------------
           72┆ `<p><a class="button" href="https://github.com/sponsors/${sponsorable}">Sponsor on
               GitHub</a></p>` +                                                                 
            ⋮┆----------------------------------------
           73┆ `<p>Then <a href="${new URL("license", url)}">sign in with GitHub to get your key</a>.</p>`
               +                                                                                          
            ⋮┆----------------------------------------
          103┆ return page(`The sign-in expired. <a href="${self}">Sign in again</a>.`, 400);
            ⋮┆----------------------------------------
          111┆ if (!token) return page(`GitHub didn't complete the sign-in. <a href="${self}">Try
               again</a>.`, 502);                                                                
   
     ❱ opt.opengrep-rules.javascript.lang.correctness.missing-template-string-indicator
          This looks like a JavaScript template string. Are you missing a '$' in front of '{...}'?
                                                                                                  
          115┆ `query($login: String!) {
          116┆   viewer { id login }
          117┆   owner: repositoryOwner(login: $login) {
          118┆     ... on Sponsorable {
          119┆       sponsorshipForViewerAsSponsor(activeOnly: false) {
          120┆         isActive createdAt tier { monthlyPriceInDollars isOneTime }
          121┆       }
          122┆     }
          123┆   }
          124┆ }`,
            ⋮┆----------------------------------------
          115┆ `query($login: String!) {
          116┆   viewer { id login }
          117┆   owner: repositoryOwner(login: $login) {
          118┆     ... on Sponsorable {
          119┆       sponsorshipForViewerAsSponsor(activeOnly: false) {
          120┆         isActive createdAt tier { monthlyPriceInDollars isOneTime }
          121┆       }
          122┆     }
          123┆   }
          124┆ }`,
   
    ❯❱ opt.opengrep-rules.javascript.lang.security.html-in-template-string
          This template literal looks like HTML and has interpolated variables. These variables are not HTML-
          encoded by default. If the variables contain HTML tags, these may be interpreted by the browser,   
          resulting in cross-site scripting (XSS).                                                           
                                                                                                             
          137┆ `or $${config.monthly} or more a month. <a href="${sponsor}">Sponsor on GitHub</a>, then
               come back to this page.`,                                                               
            ⋮┆----------------------------------------
          152┆ `<p>Your orgstar+ license key:</p><pre>${key}</pre>` +
            ⋮┆----------------------------------------
          153┆ `<p>In orgstar, open Settings ▸ orgstar+, paste the key and choose Activate. ${note}</p>`,
   
     ❱ opt.opengrep-rules.javascript.lang.correctness.missing-template-string-indicator
          This looks like a JavaScript template string. Are you missing a '$' in front of '{...}'?
                                                                                                  
          279┆ `<title>${heading}</title><style>body{font:16px/1.5 system-ui;max-width:40rem;margin:3rem
               auto;padding:0 1rem}` +                                                                  
   
    ❯❱ opt.opengrep-rules.javascript.lang.security.html-in-template-string
          This template literal looks like HTML and has interpolated variables. These variables are not HTML-
          encoded by default. If the variables contain HTML tags, these may be interpreted by the browser,   
          resulting in cross-site scripting (XSS).                                                           
                                                                                                             
          279┆ `<title>${heading}</title><style>body{font:16px/1.5 system-ui;max-width:40rem;margin:3rem
               auto;padding:0 1rem}` +                                                                  
   
     ❱ opt.opengrep-rules.javascript.lang.correctness.missing-template-string-indicator
          This looks like a JavaScript template string. Are you missing a '$' in front of '{...}'?
                                                                                                  
          279┆ `<title>${heading}</title><style>body{font:16px/1.5 system-ui;max-width:40rem;margin:3rem
               auto;padding:0 1rem}` +                                                                  
            ⋮┆----------------------------------------
          280┆ `pre{white-space:pre-wrap;word-break:break-all;background:#f4f4f4;padding:1rem;border-
               radius:6px}` +                                                                        
            ⋮┆----------------------------------------
          280┆ `pre{white-space:pre-wrap;word-break:break-all;background:#f4f4f4;padding:1rem;border-
               radius:6px}` +                                                                        
            ⋮┆----------------------------------------
          281┆ `.tiers{list-style:none;padding:0}.note{color:#666;font-size:.9rem}` +
            ⋮┆----------------------------------------
          281┆ `.tiers{list-style:none;padding:0}.note{color:#666;font-size:.9rem}` +
            ⋮┆----------------------------------------
          282┆ `.button{display:inline-block;font-weight:600;padding:.7rem 1.4rem;border-
               radius:8px;background:#d4a017;color:#fff;text-decoration:none}</style>` + 
            ⋮┆----------------------------------------
          282┆ `.button{display:inline-block;font-weight:600;padding:.7rem 1.4rem;border-
               radius:8px;background:#d4a017;color:#fff;text-decoration:none}</style>` + 
   
    ❯❱ opt.opengrep-rules.javascript.lang.security.html-in-template-string
          This template literal looks like HTML and has interpolated variables. These variables are not HTML-
          encoded by default. If the variables contain HTML tags, these may be interpreted by the browser,   
          resulting in cross-site scripting (XSS).                                                           
                                                                                                             
          283┆ `<h1>${heading}</h1>${body.startsWith("<") ? body : `<p>${body}</p>`}`;
            ⋮┆----------------------------------------
          283┆ `<h1>${heading}</h1>${body.startsWith("<") ? body : `<p>${body}</p>`}`;
                                          
    packaging/license-issuer/wrangler.toml
     ❱ opt.opengrep-rules.generic.secrets.gitleaks.generic-api-key
          A gitleaks generic-api-key was detected which attempts to identify hard-coded credentials.  It is   
          not recommended to store credentials in source-code, as this risks secrets being leaked  and used by
          either an internal or external malicious adversary. It is recommended to use  environment variables 
          to securely provide credentials or retrieve credentials from a  secure vault or HSM (Hardware       
          Security Module). This rule can introduce a lot of false positives,  it is not recommended to be    
          used in PR comments.                                                                                
                                                                                                              
           17┆ GITHUB_CLIENT_ID = "Ov23li0VjIFjZYslRU51"
                        
    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"

results uploaded