Scan report
simplecov-ruby / simplecov
Could an attacker exploit mistakes in this code?
Serious issues. Review the high-severity findings before using it.
- High
- 5
- Medium
- 40
- Low
- 0
Sources: Bandit, Semgrep, pip-audit
Does this code look like it is trying to cause harm?
Minor issues. Worth a glance, unlikely to be urgent.
- High
- 0
- Medium
- 0
- Low
- 2
Sources: YARA, ClamAV, GuardDog, dependency checker
- Likely real
- 47
- Uncertain
- 0
- Likely noise
- 0
The risk classifier rates every finding for how likely it is to be a real issue. Likely noise still counts, just much less.
What we found, in plain English
This repository has a high vulnerability score of 119.0, which means there are several common coding mistakes that could be exploited by attackers if the code is used in production. While the malicious-pattern score is very low at 2.0, suggesting the code itself is not intentionally harmful, the high vulnerability score indicates that many issues stem from standard insecure practices rather than hidden malware. The most critical finding is a controller missing cross-site request forgery protection, which could allow an attacker to trick users into visiting malicious sites. Additionally, several commands like system, spawn, and Open3 are used without verifying user input, creating potential for code injection attacks if bad data reaches these functions. There are also some concerning issues with HTML escaping and sensitive information exposure that should be addressed before the project is deployed to a live environment.
Written by a local language model from the findings below. The risk scores come from the classifier, not from this summary.
Detections by engine
Score over time
Overall score each time this repository was scanned.
Findings
Highest severity first. Select a finding to see the code and what it means.
-
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /test_projects/rails/rspec_rails/app/controllers/application_controller.rb line 1
- Likely real
- Yes, 100% confidence
Detected controller which does not enable cross-site request forgery protections using 'protect_from_forgery'. Add 'protect_from_forgery :with => :exception' to your controller class.
class ApplicationController < ActionController::Base -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/dependabot_assets.yml line 38
- Likely real
- Yes, 99% confidence
This GitHub Actions workflow file uses `pull_request_target` and checks out code from the incoming pull request. When using `pull_request_target`, the Action runs in the context of the target repository, which includes access to all repository secrets. Normally, this is safe because the Action only runs code from the target repository, not the incoming PR. However, by checking out the incoming PR code, you're now using the incoming code for the rest of the action. You may be inadvertently executing arbitrary code from the incoming PR with access to repository secrets, which would let an attacker steal repository secrets. This normally happens by running build scripts (e.g., `npm build` and `make`) or dependency installation scripts (e.g., `python setup.py install`). Audit your workflow file to make sure no code from the incoming PR is executed. Please see https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ for additional mitigations.
- uses: actions/checkout@v7.0.1 with: ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/mutation.yml line 65
- Likely real
- Yes, 57% confidence
Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".
run: | if [ "${{ github.event_name }}" = "pull_request" ]; then base="origin/${{ github.base_ref }}" else base="${{ github.event.before }}" if [ "$base" = "0000000000000000000000000000000000000000" ]; then base="HEAD~1" elif ! git cat-file -e "$base^{commit}" 2>/dev/null; then git fetch --no-tags origin "$base" 2>/dev/null || base="HEAD~1" fi fi base=$(git rev-parse "$base^{commit}") echo "Comparing against $base" count=$(bundle exec rake -s "mutant:subjects[$base]" | grep -c . || true) if [ "$count" -eq 0 ]; then total=0 else total=$(( (count + SUBJECTS_PER_SHARD - 1) / SUBJECTS_PER_SHARD )) if [ "$total" -gt "$MAX_SHARDS" ]; then total="$MAX_SHARDS"; fi fi echo "$count subject(s) across $total shard(s)" frontend=$(git diff --name-only "$base" -- html_frontend/src | grep -c '\.ts$' || true) frontend_total="$frontend" if [ "$frontend_total" -gt "$MAX_FRONTEND_SHARDS" ]; then frontend_total="$MAX_FRONTEND_SHARDS"; fi echo "$frontend frontend module(s) across $frontend_total shard(s)" { echo "base=$base" echo "count=$count" echo "total=$total" echo "shards=$(jq -nc --argjson n "$total" '[range($n)]')" echo "frontend=$frontend" echo "frontend_total=$frontend_total" echo "frontend_shards=$(jq -nc --argjson n "$frontend_total" '[range($n)]')" } >> "$GITHUB_OUTPUT" -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/push_gem.yml line 68
- Likely real
- Yes, 57% confidence
Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".
run: | tag="${{ github.ref_name }}" flags=(--verify-tag --notes-file "$RUNNER_TEMP/release-notes.md") if [ "$(ruby -Ilib -rsimplecov/version -e 'print Gem::Version.new(SimpleCov::VERSION).prerelease?')" = "true" ]; then flags+=(--prerelease) fi gh release view "$tag" >/dev/null 2>&1 || gh release create "$tag" --title "$tag" "${flags[@]}" -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/mutation.yml line 56
- Likely real
- Yes, 57% confidence
Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".
run: git fetch --no-tags origin ${{ github.base_ref }} -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /lib/simplecov/cli/affected/runner.rb line 14
- Likely real
- Yes, 100% confidence
Detected non-static command inside spawn. Audit the input to 'spawn'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.
_, status = Process.wait2(spawn(*command, chdir: root)) -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /lib/simplecov/cli/affected/runner.rb line 26
- Likely real
- Yes, 100% confidence
Detected non-static command inside system. Audit the input to 'system'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.
ran = Dir.chdir(root) { system(*command) } -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /lib/simplecov/cli/open.rb line 20
- Likely real
- Yes, 100% confidence
Detected non-static command inside system. Audit the input to 'system'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.
system(*opener, path) ? 0 : 1 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /lib/simplecov/cli/watch.rb line 55
- Likely real
- Yes, 100% confidence
Detected non-static command inside spawn. Audit the input to 'spawn'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.
Process.detach(spawn(*opener, url, out: File::NULL, err: File::NULL)) -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /spec/assets_spec.rb line 75
- Likely real
- Yes, 100% confidence
Detected non-static command inside Open3.capture3. Audit the input to 'Open3.capture3'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.
Open3.capture3(env, RbConfig.ruby, "-rbundler/setup", "-rrake", stdin_data: %(load "./Rakefile"; #{snippet}), chdir: SimpleCov.root.to_s) -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /spec/production_integration_spec.rb line 18
- Likely real
- Yes, 100% confidence
Detected non-static command inside Open3.capture3. Audit the input to 'Open3.capture3'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.
_out, stderr, status = Open3.capture3(child_env, "bundle e ruby production_test.rb #{mode}") -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /spec/support/sandbox_project.rb line 65
- Likely real
- Yes, 100% confidence
Detected non-static command inside Open3.popen2e. Audit the input to 'Open3.popen2e'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.
@last_command = Open3.popen2e( command_env, command, chdir: sandbox_dir, unsetenv_others: true ) do |stdin, stdout, wait_thread| -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /spec/support/sandbox_project.rb line 226
- Likely real
- Yes, 100% confidence
Detected non-static command inside system. Audit the input to 'system'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.
tracked = system("git", "-C", source, "ls-files", "--error-unmatch", copied, out: File::NULL, err: File::NULL) -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /spec/sandbox/file_id_collisions_spec.rb line 46
- Likely real
- Yes, 100% confidence
Should not use SHA1 to generate hashes. There is a proven SHA1 hash collision by Google, which could lead to vulnerabilities. Use SHA256, SHA3 or other hashing functions instead.
.to eq(Digest::SHA1.hexdigest("lib/file_56865.rb")[0, 8]) -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /spec/sandbox/file_id_collisions_spec.rb line 45
- Likely real
- Yes, 100% confidence
Should not use SHA1 to generate hashes. There is a proven SHA1 hash collision by Google, which could lead to vulnerabilities. Use SHA256, SHA3 or other hashing functions instead.
expect(Digest::SHA1.hexdigest("lib/file_46276.rb")[0, 8]) -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /lib/simplecov/formatter/html_formatter/public/index.html line 69
- Likely real
- Yes, 99% confidence
Detected an element with disabled HTML escaping. If external data can reach this, this is a cross-site scripting (XSS) vulnerability. Ensure no external data can reach here, or remove 'escape=false' from this element.
`),1;if(Xe>1e5&&Xe>p.index*3)throw new Error("potential infinite loop, way more iterations than matches");return x+=b,b.length}let z=N(l);if(!z)throw ne(s.replace("{}",l)),new Error('Unknown language: "'+l+'"');let Vn=Xr(z),Ze="",h=M||Vn,wt={},A=new c.__emitter(c);Xn();let x="",$e=0,te=0,Xe=0,Ve=!1;try{if(z.__emitTokens)z.__emitTokens(g,A);else{for(h.matcher.considerAll();;){Xe++,Ve?Ve=!1:h.matcher.considerAll(),h.matcher.lastIndex=te;let u=h.matcher.exec(g);if(!u)break;let p=g.substring(te,u.index),b=xt(p,u);te=u.index+b}xt(g.substring(te))}return A.finalize(),Ze=A.toHTML(),{language:l,value:Ze,relevance:$e,illegal:!1,_emitter:A,_top:h}}catch(u){if(u.message&&u.message.includes("Illegal"))return{language:l,value:Je(g),illegal:!0,relevance:0,_illegalBy:{message:u.message,index:te,context:g.slice(te-100,te+100),mode:u.mode,resultSoFar:Ze},_emitter:A};if(o)return{language:l,value:Je(g),illegal:!1,relevance:0,errorRaised:u,_emitter:A,_top:h};throw u}}function _(l){let g={value:Je(l),illegal:!1,relevance:0,_top:i,_emitter:new c.__emitter(c)};return g._emitter.addText(l),g}function L(l,g){g=g||c.languages||Object.keys(t);let E=_(l),M=g.filter(N).filter(Q).map(H=>m(H,l,!1));M.unshift(E);let C=M.sort((H,W)=>{if(H.relevance!==W.relevance)return W.relevance-H.relevance;if(H.language&&W.language){if(N(H.language).supersetOf===W.language)return 1;if(N(W.language).supersetOf===H.language)return-1}return 0}),[P,X]=C,Ne=P;return Ne.secondBest=X,Ne}function w(l,g,E){let M=g&&n[g]||E;l.classList.add("hljs"),l.classList.add(`language-${M}`)}function v(l){let g=null,E=d(l);if(a(E))return;if(ee("before:highlightElement",{el:l,language:E}),l.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",l);return}if(l.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(l)),c.throwUnescapedHTML))throw new nt("One of your code blocks includes unescaped HTML.",l.innerHTML);g=l;let M=g.textContent,C=E?f(M,{language:E,ignoreIllegals:!0}):L(M);l.innerHTML=C.value,l.dataset.highlighted="yes",w(l,E,C.language),l.result={language:C.language,re:C.relevance,relevance:C.relevance},C.secondBest&&(l.secondBest={language:C.secondBest.language,relevance:C.secondBest.relevance}),ee("after:highlightElement",{el:l,result:C,text:M})}function k(l){c=Dt(c,l)}let J=()=>{j(),de("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ce(){j(),de("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Z=!1;function j(){function l(){j()}if(document.readyState==="loading"){Z||window.addEventListener("DOMContentLoaded",l,!1),Z=!0;return}document.querySelectorAll(c.cssSelector).forEach(v)}function Ee(l,g){let E=null;try{E=g(e)}catch(M){if(ne("Language definition for '{}' could not be registered.".replace("{}",l)),o)ne(M);else throw M;E=i}E.name||(E.name=l),t[l]=E,E.rawDefinition=g.bind(null,e),E.aliases&&ce(E.aliases,{languageName:l})}function q(l){delete t[l];for(let g of Object.keys(n))n[g]===l&&delete n[g]}function _e(){return Object.keys(t)}function N(l){return l=(l||"").toLowerCase(),t[l]||t[n[l]]}function ce(l,{languageName:g}){typeof l=="string"&&(l=[l]),l.forEach(E=>{n[E.toLowerCase()]=g})}function Q(l){let g=N(l);return g&&!g.disableAutodetect}function Ae(l){l["before:highlightBlock"]&&!l["before:highlightElement"]&&(l["before:highlightElement"]=g=>{l["before:highlightBlock"](Object.assign({block:g.el},g))}),l["after:highlightBlock"]&&!l["after:highlightElement"]&&(l["after:highlightElement"]=g=>{l["after:highlightBlock"](Object.assign({block:g.el},g))})}function I(l){Ae(l),r.push(l)}function ae(l){let g=r.indexOf(l);g!==-1&&r.splice(g,1)}function ee(l,g){let E=l;r.forEach(function(M){M[E]&&M[E](g)})}function ye(l){return de("10.7.0","highlightBlock will be removed entirely in v12.0"),de("10.7.0","Please use highlightElement now."),v(l)}Object.assign(e,{highlight:f,highlightAuto:L,highlightAll:j,highlightElement:v,highlightBlock:ye,configure:k,initHighlighting:J,initHighlightingOnLoad:Ce,registerLanguage:Ee,unregisterLanguage:q,listLanguages:_e,getLanguage:N,registerAliases:ce,autoDetection:Q,inherit:Dt,addPlugin:I,removePlugin:ae}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Yr,e.regex={concat:re,lookahead:qt,either:He,optional:gr,anyNumberOfTimes:fr};for(let l in Oe)typeof Oe[l]=="object"&&Pt(Oe[l]);return Object.assign(e,Oe),e},fe=Vt({});fe.newInstance=()=>Vt({});Yt.exports=fe;fe.HighlightJS=fe;fe.default=fe});function $(e,t){return(t||document).querySelector(e)}function y(e,t){return Array.from((t||document).querySelectorAll(e))}function U(e,t,n,r){typeof n=="function"?e.addEventListener(t,n):e.addEventListener(t,function(o){let s=o.target.closest(n);s&&e.contains(s)&&r&&r.call(s,o)})}var cr={"&":"&","<":"<",">":">",'"':""","'":"'"};function T(e){return e.replace(/[&<>"']/g,t=>cr[t])}function Tt(e){return le(this,null,function*(){let t=new TextEncoder().encode(e),n=yield crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(n,0,4),r=>r.toString(16).padStart(2,"0")).join("")})}var ar=90,lr=75;function F(e){return e>=ar?"green":e>=lr?"yellow":"red"}function O(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function D(e){return(Math.floor(e*100)/100).toFixed(2)}function Ct(e){return"g-"+e.replace(/[^a-zA-Z0-9-]/gu,t=>`_${t.codePointAt(0).toString(16)}_`)}var At=[[31536e3,"year"],[2592e3,"month"],[86400,"day"],[3600,"hour"],[60,"minute"],[1,"second"]];function Nt(e){let t=Math.floor((Date.now()-e.getTime())/1e3);for(let[n,r]of At){let o=Math.floor(t/n);if(o>=1)return o===1?`about 1 ${r} ago`:`${o} ${r}s ago`}return"just now"}function Rt(e){let t=(Date.now()-e.getTime())/1e3;for(let[n]of At){let r=Math.floor(t/n);if(r>=1){let o=(r+1)*n;return Math.max((o-t)*1e3+500,1e3)}}return 1e3}var Ye=new Map;function ue(e){let t=Ye.get(e);if(t===void 0)throw new Error(`File ID was not precomputed for ${e}`);return t}function $t(e){return le(this,null,function*(){Ye.clear();let t=[...new Set(e)],n=yield Promise.all(t.map(Tt)),r=new Map;t.forEach((o,s)=>{let i=n[s],c=r.get(i)||[];c.push(o),r.set(i,c)});for(let[o,s]of r)s.sort().forEach((i,c)=>{Ye.set(i,c===0?o:`${o}-${c}`)})})}var Qt=sr(Jt(),1);var ge=Qt.default;function en(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(r,/(::\w+)*/),i={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},c={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},d=[e.COMMENT("#","$",{contains:[c]}),e.COMMENT("^=begin","^=end",{contains:[c],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:i},m={className:"string",contains:[e.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,f]})]}]},_="[1-9](_?[0-9])*|0",L="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:`\\b(${_})(\\.(${L}))?([eE][+-]?(${L})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:i}]},q=[m,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:i},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:i},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{begin:"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[m,{begin:n}],relevance:0},w,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:i},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,d),relevance:0}].concat(a,d);f.contains=q,v.contains=q;let Q=[{begin:/^\s*=>/,starts:{end:"$",contains:q}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:i,contains:q}}];return d.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:i,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(Q).concat(d).concat(q)}}function tn(e){return{name:"HAML",case_insensitive:!0,contains:[{className:"meta",begin:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",relevance:10},e.COMMENT("^\\s*(!=#|=#|-#|/).*$",null,{relevance:0}),{begin:"^\\s*(-|=|!=)(?!#)",end:/$/,subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0},{className:"tag",begin:"^\\s*%",contains:[{className:"selector-tag",begin:"\\w+"},{className:"selector-id",begin:"#[\\w-]+"},{className:"selector-class",begin:"\\.[\\w-]+"},{begin:/\{\s*/,end:/\s*\}/,contains:[{begin:":\\w+\\s*=>",end:",\\s+",returnBegin:!0,endsWithParent:!0,contains:[{className:"attr",begin:":\\w+"},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{begin:"\\w+",relevance:0}]}]},{begin:"\\(\\s*",end:"\\s*\\)",excludeEnd:!0,contains:[{begin:"\\w+\\s*=",end:"\\s+",returnBegin:!0,endsWithParent:!0,contains:[{className:"attr",begin:"\\w+",relevance:0},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{begin:"\\w+",relevance:0}]}]}]},{begin:"^\\s*[=~]\\s*"},{begin:/#\{/,end:/\}/,subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0}]}}var Qr={endsWithParent:!0,relevance:0,contains:[{className:"attr",begin:/[A-Za-z_:][-A-Za-z0-9_:.]*/,relevance:0},{className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]}]};function it(e){return{name:"ERB",contains:[e.COMMENT("<%#","%>"),{begin:/<%[%=-]?/,end:/[%-]?%>/,subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0},{className:"tag",begin:/<\/?(?=[A-Za-z])/,end:/\/?>/,contains:[{className:"name",begin:/[A-Za-z][^\s/>]*/,relevance:0,starts:Qr}]}]}}function st(e){return{name:"Slim",contains:[e.COMMENT(/^\s*\/!?/,/$/),{begin:/^\s*(?:-|={1,2})[<>']*/,end:/$/,subLanguage:"ruby",excludeBegin:!0,relevance:0},{className:"name",begin:/^\s*[A-Za-z][A-Za-z0-9_-]*/,relevance:0,starts:{end:/\s/,relevance:0,contains:[{className:"selector-class",begin:/\.[A-Za-z][A-Za-z0-9_-]*/,relevance:0},{className:"selector-id",begin:/#[A-Za-z][A-Za-z0-9_-]*/,relevance:0}]}},{className:"selector-class",begin:/^\s*\.[A-Za-z][A-Za-z0-9_-]*/,relevance:0},{className:"selector-id",begin:/^\s*#[A-Za-z][A-Za-z0-9_-]*/,relevance:0}]}}function eo(e){if(e==="oneshot_line")return"line";if(e==="line"||e==="branch"||e==="method")return e}function nn(e){let t=eo(e.primary_coverage);return t==="branch"&&e.branch_coverage||t==="method"&&e.method_coverage?t:e.line_coverage?"line":e.branch_coverage?"branch":"method"}function to(e,t){return t==="line"?e.lines:t==="branch"?e.branches:e.methods}function Be(e,t){return to(e,t)||e.lines||e.branches||e.methods}function Pe(e,t){let n=Array.from({length:t},()=>[]);for(let[r,o]of Object.entries(e||{})){let s=Number(r);Array.from(o).reverse().forEach((i,c)=>{let a=parseInt(i,16);for(let d of[0,1,2,3]){if(!(a&1<<d))continue;let f=c*4+d;f<t&&n[f].push(s)}})}return{perLine:n}}function rn(e,t){if(!t)return 0;let n=[];for(let o of Object.values(e||{}))Array.from(o).reverse().forEach((s,i)=>{n[i]=(n[i]||0)|parseInt(s,16)});let r=0;return t.forEach((o,s)=>{typeof o!="number"||o<=0||(n[s>>2]||0)&1<<(s&3)||r++}),r}function on(e,t,n){let r=e.perLine[n-1];return r?r.map(o=>t[o]).sort():[]}function at(e,t){let n=F(e);return t?`<div class="bar-sizer"><div class="coverage-bar"><div class="coverage-bar__fill coverage-bar__fill--${n} coverage-bar__fill--split" style="width: ${D(e-t)}%"></div><div class="coverage-bar__fill coverage-bar__fill--outside" style="width: ${D(t)}%"></div></div></div>`:`<div class="bar-sizer"><div class="coverage-bar"><div class="coverage-bar__fill coverage-bar__fill--${n}" style="width: ${D(e)}%"></div></div></div>`}function oe(e,t,n,r,o,s){let i=F(e),c=D(e),a=s===void 0||n===0?void 0:s*100/n,d=`<div class="coverage-cell">${at(e,a)}<span class="coverage-pct">${c}%</span></div>`;if(o)return`<td class="cell--coverage strong t-totals__${r}-pct ${i}">${d}</td><td class="cell--numerator strong t-totals__${r}-num">${O(t)}/</td><td class="cell--denominator strong t-totals__${r}-den">${O(n)}</td>`;let f=a===void 0?"":` data-order-2="${D(e-a)}"`,m=` data-order="${D(e)}"${f}`;return`<td class="cell--coverage cell--${r}-pct ${i}"${m}>${d}</td><td class="cell--numerator" data-order="${t}">${O(t)}/</td><td class="cell--denominator" data-order="${n}">${O(n)}</td>`}function Fe(e,t,n,r){return`<th class="cell--coverage" data-sort-key="${t}-percent"> -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /test_projects/rails/view_demo/config/environments/test.rb line 11
- Likely real
- Yes, 81% confidence
Found that the setting for providing detailed exception reports in Rails is set to true. This can lead to information exposure, where sensitive system or internal information is displayed to the end user. Instead, turn this setting off.
config.consider_all_requests_local = true -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /test_projects/rails/rspec_rails/config/environments/development.rb line 15
- Likely real
- Yes, 81% confidence
Found that the setting for providing detailed exception reports in Rails is set to true. This can lead to information exposure, where sensitive system or internal information is displayed to the end user. Instead, turn this setting off.
config.consider_all_requests_local = true -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /test_projects/rails/rspec_rails/config/environments/test.rb line 25
- Likely real
- Yes, 81% confidence
Found that the setting for providing detailed exception reports in Rails is set to true. This can lead to information exposure, where sensitive system or internal information is displayed to the end user. Instead, turn this setting off.
config.consider_all_requests_local = true -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /test_projects/rails/minitest_rails/config/environments/test.rb line 5
- Likely real
- Yes, 81% confidence
Found that the setting for providing detailed exception reports in Rails is set to true. This can lead to information exposure, where sensitive system or internal information is displayed to the end user. Instead, turn this setting off.
config.consider_all_requests_local = true -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /benchmarks/collate/rss_sampler.rb line 24
- Likely real
- Yes, 56% confidence
Detected non-static command inside `...`. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.
`ps -o rss= -p #{Process.pid}`.to_i * 1024 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /benchmarks/report_scale.rb line 61
- Likely real
- Yes, 56% confidence
Detected non-static command inside `...`. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code.
rss_mb: `ps -o rss= -p #{Process.pid}`.to_i / 1024) -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/typecheck.yml line 19
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/checkout@v7.0.1 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/stable.yml line 63
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/cache@v6.1.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/mutation.yml line 160
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: ruby/setup-ruby@v1.323.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/stable.yml line 53
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: ruby/setup-ruby@v1.323.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/stable.yml line 47
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/checkout@v7.0.1 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/unstable.yml line 86
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: ruby/setup-ruby@v1.323.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/typecheck.yml line 21
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: oven-sh/setup-bun@v2 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/typecheck.yml line 23
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: ruby/setup-ruby@v1.323.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/unstable.yml line 35
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/checkout@v7.0.1 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/unstable.yml line 46
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: ruby/setup-ruby@v1.323.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/unstable.yml line 59
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/cache@v6.1.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/unstable.yml line 84
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/checkout@v7.0.1 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/mutation.yml line 158
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: oven-sh/setup-bun@v2 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/mutation.yml line 154
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/checkout@v7.0.1 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/mutation.yml line 123
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: ruby/setup-ruby@v1.323.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/mutation.yml line 119
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/checkout@v7.0.1 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/mutation.yml line 48
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: ruby/setup-ruby@v1.323.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/mutation.yml line 44
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/checkout@v7.0.1 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/lint.yml line 18
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: ruby/setup-ruby@v1.323.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/lint.yml line 16
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/checkout@v7.0.1 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/dependabot_assets.yml line 45
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: ruby/setup-ruby@v1.323.0 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/dependabot_assets.yml line 43
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: oven-sh/setup-bun@v2 -
- Engine
- Semgrep · Pattern-based code analysis
- Counts towards
- Vulnerability
- File
- /.github/workflows/dependabot_assets.yml line 38
- Likely real
- Yes, 52% confidence
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
- uses: actions/checkout@v7.0.1 -
- Engine
- GuardDog · Supply-chain attack heuristics
- Counts towards
- Malicious pattern
- File
- /spec/simple_cov/cli_spec.rb line 9026
- Likely real
- Yes, 91% confidence
Detects access to sensitive files (credentials, configs, keys) [threat-filesystem-read]
it "refuses an absolute path outright" do expect(handler.resolve("//etc/passwd", tmp)).to eq(:forbidden) end -
- Engine
- GuardDog · Supply-chain attack heuristics
- Counts towards
- Malicious pattern
- File
- /spec/simple_cov/cli_spec.rb line 8985
- Likely real
- Yes, 91% confidence
Detects access to sensitive files (credentials, configs, keys) [threat-filesystem-read]
it "counts out somewhere else entirely" do expect(handler.send(:inside?, "/etc/passwd", "/srv/report")).to be false end end
No findings match these filters.