Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/rubyonrails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
uses: actions/checkout@v4
# Add or replace dependency steps here
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1 # v1.146.0

Check warning on line 33 in .github/workflows/rubyonrails.yml

View check run for this annotation

APPLICATION-SECURITY-AGENT / SAST

Vulnerability found with Rule : base.yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha .

Description : **Supply Chain Risk via Unpinned Third-Party GitHub Action** A third-party GitHub Action is referenced by a mutable tag or branch (e.g. `@v1`, `@main`) instead of a full-length commit SHA. Tags and branches can be silently re-pointed by the upstream maintainer or an attacker who compromises that repository, causing your workflow to execute unexpected code with access to your repository secrets. **Risk:** A compromised or hijacked upstream action can exfiltrate secrets (`GITHUB_TOKEN`, deploy keys, cloud credentials), inject malicious build artifacts, or pivot into protected environments. Recent supply-chain incidents (e.g. `tj-actions/changed-files`) demonstrate this is an active attack vector. **Common in GitHub Actions:** Semantic-version tags (`@v3`) and branch refs (`@main`, `@master`) are mutable in Git and are not equivalent to immutable releases. Only a full 40-character commit SHA pins the action to a specific, verifiable snapshot. Take Action : If you think this vulnerability is a false positive or not exploitable, please put the triageId: .github/workflows/rubyonrails.yml:6e8f1736ffde1bddbd4e6235f5a0359c3e39cc4d0537ff5ce947f431eaad75d5 under respective sections: false_positive or not_exploitable in the triage.yaml file at this location sfdc_metadata/sast_scan_triage/triage.yaml. If the vulnerability is true positive please proceed with remediation to ensure secure code. Suggested Remediation : Pin every third-party action to a full-length (40-character) commit SHA and keep the human-readable version in a trailing comment for reviewers. Renovate/Dependabot can then update the SHA safely. Example: # Vulnerable - mutable tag can be re-pointed by upstream - uses: some-org/some-action@v3 # Vulnerable - branch ref is mutable - uses: some-org/some-action@main # Secure - full commit SHA (immutable), version pinned in comment - uses: some-org/some-action@abcdef0123456789abcdef0123456789abcdef01 # v3.1.0 # Secure - docker action pinned by image digest - uses: docker://alpine@sha256:402d21757a03a114d273bbe372fa4b9eca567e8b6c332fa7ebf982b902207242 For a sample triage.yaml file format please visit the Raw output section. For more details, please refer to checks tab and go to the APPLICATION-SECURITY-AGENT/SAST check.
Raw output
false_positive:
  - id: .github/workflows/rubyonrails.yml:6e8f1736ffde1bddbd4e6235f5a0359c3e39cc4d0537ff5ce947f431eaad75d5
    justification: <Enter your justification for false positive here>
not_exploitable: []
with:
# ubuntu-latest only publishes the newest patch of each Ruby series.
ruby-version: '3.3'
bundler-cache: true

- name: Set up database schema
Expand All @@ -47,9 +49,10 @@
- name: Checkout code
uses: actions/checkout@v4
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1

Check warning on line 52 in .github/workflows/rubyonrails.yml

View check run for this annotation

APPLICATION-SECURITY-AGENT / SAST

Vulnerability found with Rule : base.yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha .

Description : **Supply Chain Risk via Unpinned Third-Party GitHub Action** A third-party GitHub Action is referenced by a mutable tag or branch (e.g. `@v1`, `@main`) instead of a full-length commit SHA. Tags and branches can be silently re-pointed by the upstream maintainer or an attacker who compromises that repository, causing your workflow to execute unexpected code with access to your repository secrets. **Risk:** A compromised or hijacked upstream action can exfiltrate secrets (`GITHUB_TOKEN`, deploy keys, cloud credentials), inject malicious build artifacts, or pivot into protected environments. Recent supply-chain incidents (e.g. `tj-actions/changed-files`) demonstrate this is an active attack vector. **Common in GitHub Actions:** Semantic-version tags (`@v3`) and branch refs (`@main`, `@master`) are mutable in Git and are not equivalent to immutable releases. Only a full 40-character commit SHA pins the action to a specific, verifiable snapshot. Take Action : If you think this vulnerability is a false positive or not exploitable, please put the triageId: .github/workflows/rubyonrails.yml:6e8f1736ffde1bddbd4e6235f5a0359c3e39cc4d0537ff5ce947f431eaad75d5 under respective sections: false_positive or not_exploitable in the triage.yaml file at this location sfdc_metadata/sast_scan_triage/triage.yaml. If the vulnerability is true positive please proceed with remediation to ensure secure code. Suggested Remediation : Pin every third-party action to a full-length (40-character) commit SHA and keep the human-readable version in a trailing comment for reviewers. Renovate/Dependabot can then update the SHA safely. Example: # Vulnerable - mutable tag can be re-pointed by upstream - uses: some-org/some-action@v3 # Vulnerable - branch ref is mutable - uses: some-org/some-action@main # Secure - full commit SHA (immutable), version pinned in comment - uses: some-org/some-action@abcdef0123456789abcdef0123456789abcdef01 # v3.1.0 # Secure - docker action pinned by image digest - uses: docker://alpine@sha256:402d21757a03a114d273bbe372fa4b9eca567e8b6c332fa7ebf982b902207242 For a sample triage.yaml file format please visit the Raw output section. For more details, please refer to checks tab and go to the APPLICATION-SECURITY-AGENT/SAST check.
Raw output
false_positive:
  - id: .github/workflows/rubyonrails.yml:6e8f1736ffde1bddbd4e6235f5a0359c3e39cc4d0537ff5ce947f431eaad75d5
    justification: <Enter your justification for false positive here>
not_exploitable: []
with:
ruby-version: '3.3.8'
# ubuntu-latest only publishes the newest patch of each Ruby series.
ruby-version: '3.3'
bundler-cache: true
# Add or replace any other lints here
- name: Security audit dependencies
Expand Down
17 changes: 11 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.3.8'
ruby '~> 3.3.8'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 8.1.3', '>= 8.1.3.1'
gem 'rails', '~> 8.1.3', '>= 8.1.4.1'

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'
Expand All @@ -15,7 +15,7 @@ gem 'sprockets-rails'
gem 'pg', '~> 1.1'

# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '>= 7.2.1', '< 8.0'
gem 'puma', '>= 7.2.2', '< 8.0'

# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem 'importmap-rails'
Expand Down Expand Up @@ -96,19 +96,24 @@ gem 'httparty', '>= 0.24.0'
gem 'faraday', '>= 2.14.2', '< 3.0'

# Security: direct minimum versions to address current advisories
gem 'addressable', '>= 2.9.0'
gem 'addressable', '>= 2.9.1'
gem 'jwt', '>= 2.10.3'
gem 'rack-session', '>= 2.1.2'
gem 'erb', '>= 6.0.4'
gem 'net-imap', '>= 0.6.4'

# Security: Fix GHSA-c4rq-3m3g-8wgx, GHSA-v2fc-qm4h-8hqv (nokogiri), CVE-2026-22860, CVE-2026-25500 (rack)
gem 'nokogiri', '>= 1.19.3'
gem 'rack', '~> 3.1.20'
gem 'nokogiri', '>= 1.19.5'
gem 'rack', '~> 3.1.23'

# Security: Fix GHSA-pp92-crg2-gfv9 (oauth2 redirect/authority leak)
gem 'oauth2', '>= 2.0.22'

# Security: patched floors from bundler-audit (Rails 8.1.4.1 advisory set)
gem 'loofah', '>= 2.25.3'
gem 'msgpack', '>= 1.8.7'
gem 'rails-html-sanitizer', '>= 1.7.2'

# Markdown renderer
gem 'redcarpet'

Expand Down
170 changes: 87 additions & 83 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,66 @@ GEM
specs:
action_text-trix (2.1.19)
railties
actioncable (8.1.4)
actionpack (= 8.1.4)
activesupport (= 8.1.4)
actioncable (8.1.4.1)
actionpack (= 8.1.4.1)
activesupport (= 8.1.4.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (8.1.4)
actionpack (= 8.1.4)
activejob (= 8.1.4)
activerecord (= 8.1.4)
activestorage (= 8.1.4)
activesupport (= 8.1.4)
actionmailbox (8.1.4.1)
actionpack (= 8.1.4.1)
activejob (= 8.1.4.1)
activerecord (= 8.1.4.1)
activestorage (= 8.1.4.1)
activesupport (= 8.1.4.1)
mail (>= 2.8.0)
actionmailer (8.1.4)
actionpack (= 8.1.4)
actionview (= 8.1.4)
activejob (= 8.1.4)
activesupport (= 8.1.4)
actionmailer (8.1.4.1)
actionpack (= 8.1.4.1)
actionview (= 8.1.4.1)
activejob (= 8.1.4.1)
activesupport (= 8.1.4.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (8.1.4)
actionview (= 8.1.4)
activesupport (= 8.1.4)
actionpack (8.1.4.1)
actionview (= 8.1.4.1)
activesupport (= 8.1.4.1)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (8.1.4)
actiontext (8.1.4.1)
action_text-trix (~> 2.1.15)
actionpack (= 8.1.4)
activerecord (= 8.1.4)
activestorage (= 8.1.4)
activesupport (= 8.1.4)
actionpack (= 8.1.4.1)
activerecord (= 8.1.4.1)
activestorage (= 8.1.4.1)
activesupport (= 8.1.4.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (8.1.4)
activesupport (= 8.1.4)
actionview (8.1.4.1)
activesupport (= 8.1.4.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (8.1.4)
activesupport (= 8.1.4)
rails-html-sanitizer (~> 1.6, >= 1.7.2)
activejob (8.1.4.1)
activesupport (= 8.1.4.1)
globalid (>= 0.3.6)
activemodel (8.1.4)
activesupport (= 8.1.4)
activerecord (8.1.4)
activemodel (= 8.1.4)
activesupport (= 8.1.4)
activemodel (8.1.4.1)
activesupport (= 8.1.4.1)
activerecord (8.1.4.1)
activemodel (= 8.1.4.1)
activesupport (= 8.1.4.1)
timeout (>= 0.4.0)
activestorage (8.1.4)
actionpack (= 8.1.4)
activejob (= 8.1.4)
activerecord (= 8.1.4)
activesupport (= 8.1.4)
activestorage (8.1.4.1)
actionpack (= 8.1.4.1)
activejob (= 8.1.4.1)
activerecord (= 8.1.4.1)
activesupport (= 8.1.4.1)
marcel (~> 1.0)
activesupport (8.1.4)
activesupport (8.1.4.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
Expand All @@ -76,7 +76,7 @@ GEM
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
acts_as_votable (0.14.0)
addressable (2.9.0)
addressable (2.9.2)
public_suffix (>= 2.0.2, < 8.0)
akami (1.3.3)
base64
Expand Down Expand Up @@ -192,7 +192,7 @@ GEM
gyoku (1.4.0)
builder (>= 2.1.2)
rexml (~> 3.0)
hashie (5.1.0)
hashie (5.2.0)
logger
httparty (0.24.2)
csv
Expand All @@ -211,8 +211,8 @@ GEM
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
io-console (0.9.4)
irb (1.18.0)
io-console (0.9.5)
irb (1.19.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
Expand All @@ -238,9 +238,9 @@ GEM
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
loofah (2.25.2)
loofah (2.25.3)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
nokogiri (>= 1.19.5)
mail (2.9.1)
logger
mini_mime (>= 0.1.1)
Expand All @@ -250,10 +250,10 @@ GEM
marcel (1.2.1)
matrix (0.4.3)
mini_mime (1.1.5)
minitest (6.0.6)
minitest (6.1.0)
drb (~> 2.0)
prism (~> 1.5)
msgpack (1.8.3)
prism (>= 1.5, < 3)
msgpack (1.8.7)
multi_xml (0.9.1)
bigdecimal (>= 3.1, < 5)
multipart-post (2.4.1)
Expand All @@ -274,11 +274,11 @@ GEM
net-protocol
nio4r (2.7.5)
nkf (0.3.0)
nokogiri (1.19.4-arm64-darwin)
nokogiri (1.19.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.19.4-x86_64-darwin)
nokogiri (1.19.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.19.4-x86_64-linux-gnu)
nokogiri (1.19.7-x86_64-linux-gnu)
racc (~> 1.4)
nori (2.7.1)
bigdecimal
Expand All @@ -291,10 +291,11 @@ GEM
rack (>= 1.2, < 4)
snaky_hash (~> 2.0, >= 2.0.5)
version_gem (~> 1.1, >= 1.1.11)
omniauth (2.1.3)
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
omniauth (2.2.0)
hashie (>= 3.5.2)
logger
rack (>= 2.2.8)
rack-protection (>= 2.2.0)
omniauth-google-oauth2 (1.2.1)
jwt (>= 2.9.2)
oauth2 (~> 2.0)
Expand Down Expand Up @@ -325,16 +326,16 @@ GEM
prism (1.9.0)
pstore (0.2.1)
public_suffix (7.0.5)
puma (7.2.1)
puma (7.2.3)
nio4r (~> 2.0)
pundit (2.5.0)
activesupport (>= 3.0.0)
racc (1.8.1)
rack (3.1.22)
rack (3.1.23)
rack-cors (3.0.0)
logger
rack (>= 3.0.14)
rack-protection (4.1.1)
rack-protection (4.2.1)
base64 (>= 0.1.0)
logger (>= 1.6.0)
rack (>= 3.0.0, < 4)
Expand All @@ -345,20 +346,20 @@ GEM
rack (>= 1.3)
rackup (2.3.1)
rack (>= 3)
rails (8.1.4)
actioncable (= 8.1.4)
actionmailbox (= 8.1.4)
actionmailer (= 8.1.4)
actionpack (= 8.1.4)
actiontext (= 8.1.4)
actionview (= 8.1.4)
activejob (= 8.1.4)
activemodel (= 8.1.4)
activerecord (= 8.1.4)
activestorage (= 8.1.4)
activesupport (= 8.1.4)
rails (8.1.4.1)
actioncable (= 8.1.4.1)
actionmailbox (= 8.1.4.1)
actionmailer (= 8.1.4.1)
actionpack (= 8.1.4.1)
actiontext (= 8.1.4.1)
actionview (= 8.1.4.1)
activejob (= 8.1.4.1)
activemodel (= 8.1.4.1)
activerecord (= 8.1.4.1)
activestorage (= 8.1.4.1)
activesupport (= 8.1.4.1)
bundler (>= 1.15.0)
railties (= 8.1.4)
railties (= 8.1.4.1)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -367,12 +368,12 @@ GEM
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.7.1)
loofah (~> 2.25, >= 2.25.2)
rails-html-sanitizer (1.7.2)
loofah (~> 2.25, >= 2.25.3)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (8.1.4)
actionpack (= 8.1.4)
activesupport (= 8.1.4)
railties (8.1.4.1)
actionpack (= 8.1.4.1)
activesupport (= 8.1.4.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand Down Expand Up @@ -533,10 +534,10 @@ GEM
event_emitter
mutex_m
websocket
websocket-driver (0.8.2)
websocket-driver (0.9.0)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
websocket-extensions (>= 0.2.0)
websocket-extensions (0.2.0)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.8.3)
Expand All @@ -552,7 +553,7 @@ PLATFORMS

DEPENDENCIES
acts_as_votable
addressable (>= 2.9.0)
addressable (>= 2.9.1)
bcrypt (>= 3.1.22)
bootsnap
brakeman
Expand All @@ -574,23 +575,26 @@ DEPENDENCIES
jbuilder
jwt (>= 2.10.3)
kaminari
loofah (>= 2.25.3)
msgpack (>= 1.8.7)
neighbor
net-imap (>= 0.6.4)
nokogiri (>= 1.19.3)
nokogiri (>= 1.19.5)
oauth2 (>= 2.0.22)
omniauth-google-oauth2
optparse
pager_duty-connection
pg (~> 1.1)
pg_search
pgvector
puma (>= 7.2.1, < 8.0)
puma (>= 7.2.2, < 8.0)
pundit (~> 2.3)
rack (~> 3.1.20)
rack (~> 3.1.23)
rack-cors
rack-session (>= 2.1.2)
rails (~> 8.1.3, >= 8.1.3.1)
rails (~> 8.1.3, >= 8.1.4.1)
rails-controller-testing
rails-html-sanitizer (>= 1.7.2)
redcarpet
redis (~> 4.0)
restforce
Expand Down
Loading