Skip to content
Snippets Groups Projects
  1. Jan 25, 2022
  2. Jan 24, 2022
  3. Jan 23, 2022
    • Claire's avatar
      Fix error-prone SQL queries (#15828) · 0a120d86
      Claire authored
      * Fix error-prone SQL queries in Account search
      
      While this code seems to not present an actual vulnerability, one could
      easily be introduced by mistake due to how the query is built.
      
      This PR parameterises the `to_tsquery` input to make the query more robust.
      
      * Harden code for Status#tagged_with_all and Status#tagged_with_none
      
      Those two scopes aren't used in a way that could be vulnerable to an SQL
      injection, but keeping them unchanged might be a hazard.
      
      * Remove unneeded spaces surrounding tsquery term
      
      * Please CodeClimate
      
      * Move advanced_search_for SQL template to its own function
      
      This avoids one level of indentation while making clearer that the SQL template
      isn't build from all the dynamic parameters of advanced_search_for.
      
      * Add tests covering tagged_with, tagged_with_all and tagged_with_none
      
      * Rewrite tagged_with_none to avoid multiple joins and make it more robust
      
      * Remove obsolete brakeman warnings
      
      * Revert "Remove unneeded spaces surrounding tsquery term"
      
      The two queries are not strictly equivalent.
      
      This reverts commit 86f16c537e06c6ba4a8b250f25dcce9f049023ff.
      Unverified
      0a120d86
    • Claire's avatar
    • Claire's avatar
      Add OMNIAUTH_ONLY environment variable to enforce externa log-in (#17288) · bddd9ba3
      Claire authored
      * Remove support for OAUTH_REDIRECT_AT_SIGN_IN
      
      Fixes #15959
      
      Introduced in #6540, OAUTH_REDIRECT_AT_SIGN_IN allowed skipping the log-in form
      to instead redirect to the external OmniAuth login provider.
      
      However, it did not prevent the log-in form on /about introduced by #10232 from
      appearing, and completely broke with the introduction of #15228.
      
      As I restoring that previous log-in flow without introducing a security
      vulnerability may require extensive care and knowledge of how OmniAuth works,
      this commit removes support for OAUTH_REDIRECT_AT_SIGN_IN instead for the time
      being.
      
      * Add OMNIAUTH_ONLY environment variable to enforce external log-in only
      
      * Disable user registration when OMNIAUTH_ONLY is set to true
      
      * Replace log-in links When OMNIAUTH_ONLY is set with exactly one OmniAuth provider
      Unverified
      bddd9ba3
    • Claire's avatar
      Remove support for OAUTH_REDIRECT_AT_SIGN_IN (#17287) · cfa583fa
      Claire authored
      Fixes #15959
      
      Introduced in #6540, OAUTH_REDIRECT_AT_SIGN_IN allowed skipping the log-in form
      to instead redirect to the external OmniAuth login provider.
      
      However, it did not prevent the log-in form on /about introduced by #10232 from
      appearing, and completely broke with the introduction of #15228.
      
      As I restoring that previous log-in flow without introducing a security
      vulnerability may require extensive care and knowledge of how OmniAuth works,
      this commit removes support for OAUTH_REDIRECT_AT_SIGN_IN instead for the time
      being.
      Unverified
      cfa583fa
    • Claire's avatar
      Remove leftover database columns from Devise::Models::Rememberable (#17191) · 8a07ecd3
      Claire authored
      * Remove leftover database columns from Devise::Models::Rememberable
      
      * Update fix-duplication maintenance script
      
      * Improve errors/warnings in the fix-duplicates maintenance script
      Unverified
      8a07ecd3
    • Claire's avatar
      Remove old duplicate index (#17245) · 96f0b33c
      Claire authored
      Some Mastodon versions (v1.1 and v1.2) had a duplicate index in `db/schema.rb`
      without any migration script creating it. #2224 (included in v1.3) removed the
      duplicate index from the file but did not provide a migration script to remove
      it.
      
      This means that any instance that was installed from v1.1 or v1.2's source code
      has a duplicate index and a corresponding warning in PgHero. Instances set up
      using an earlier or later Mastodon version do not have this issue.
      
      This PR removes the duplicate index if it is present.
      Unverified
      96f0b33c
  4. Jan 20, 2022
  5. Jan 19, 2022
  6. Jan 18, 2022
Loading