forked from maybe-finance/maybe
-
Notifications
You must be signed in to change notification settings - Fork 892
security: input validation & injection fixes (XSS, constantize, open redirects, CSV, SQL) #1517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dgilperez
wants to merge
11
commits into
we-promise:main
Choose a base branch
from
dgilperez:security/pr1-input-validation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
41aae01
fix(security): sanitize markdown output to prevent stored XSS (FIX-05…
dgilperez 6ed5e47
fix(security): sanitize GitHub release notes in changelog (FIX-06)
dgilperez 8668f78
fix(security): allowlist class names in import mappings controller (F…
dgilperez c84911e
fix(security): sanitize return_to to prevent open redirect (FIX-08)
dgilperez 129c86f
fix(security): allowlist accountable types in AccountImport (F-07)
dgilperez 9e46393
fix(security): escape CSV formula injection in family data export (F-09)
dgilperez 340458b
fix(security): sanitize account return_to redirect (F-10)
dgilperez 86475aa
fix(security): eliminate SQL interpolation in reports ORDER BY (CRIT-02)
dgilperez a085524
fix(security): escape LIKE wildcards in API transactions search (HIGH…
dgilperez b2b7b51
fix(security): filter raw HTML in guides markdown renderer (HIGH-05)
dgilperez 268abe9
fix(security): address CodeRabbit review
dgilperez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| require "test_helper" | ||
|
|
||
| class AccountImportSecurityTest < ActiveSupport::TestCase | ||
| test "ALLOWED_ACCOUNTABLE_TYPES mirrors Accountable::TYPES (guards against drift)" do | ||
| assert_equal Accountable::TYPES.sort, AccountImport::ALLOWED_ACCOUNTABLE_TYPES.sort | ||
| end | ||
|
|
||
| test "all ALLOWED_ACCOUNTABLE_TYPES resolve via Accountable.from_type" do | ||
| AccountImport::ALLOWED_ACCOUNTABLE_TYPES.each do |type| | ||
| assert_not_nil Accountable.from_type(type), "#{type} should resolve to a class" | ||
| end | ||
| end | ||
|
|
||
| test "Accountable.from_type rejects unknown input" do | ||
| assert_nil Accountable.from_type("ActiveRecord::Base") | ||
| assert_nil Accountable.from_type("NotAClass") | ||
| assert_nil Accountable.from_type(nil) | ||
| assert_nil Accountable.from_type("") | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.