Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-13191

URISupport sanitizeUri don't hide complete password if password contains colon

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.23.1
    • Fix Version/s: 2.23.2, 2.24.0, 2.22.4, 3.0.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      sanitizedUri don't hide the complete password if the password contains a colon.

      e.g.

      camel route URI is "sftp://user:hidden:password@target.test" where the password is "hidden:password" 

      the sanitizedUri method will only hide the last part of password (sftp://user:hidden:xxxxxx@target.test)

      UnitTest
      import org.apache.camel.util.URISupport;
      import org.junit.jupiter.api.Assertions;
      import org.junit.jupiter.api.Test;
      
      class UriSupportTest {
      
        @Test
        void testURISanitizeUri() {
          var sanitizedUri = URISupport.sanitizeUri("sftp://user:hidden:Password@target.test");
          Assertions.assertEquals("sftp://user:xxxxxx@target.test", sanitizedUri);
        }
      
      }
      
      

       

        Attachments

          Activity

            People

            • Assignee:
              acosentino Andrea Cosentino
              Reporter:
              Pieczewski Christian Pieczewski
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 20m
                1h 20m