Project

General

Profile

Bug #30064

RootRepository password length too short

Added by Partha Aji 5 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Repositories
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

The upstream_password in the root repository table was created to hold auto generated keys of 760 characters and above 1024. However check the code here

[1] pry(main)> a = Katello::RootRepository.last
=> #<Katello::RootRepository:0x0000000010baad50
 id: 5,
 ....
 ....
 http_proxy_id: nil>

[4] pry(main)> a.upstream_password = "A"*500
=> "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" 
[5] pry(main)> a.save!
ActiveRecord::ValueTooLong: PG::StringDataRightTruncation: ERROR:  value too long for type character varying(1024)

from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'
Caused by PG::StringDataRightTruncation: ERROR:  value too long for type character varying(1024)

from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'

  • Create a root repository and give it an upstream password > 500 characters.

Expected:
Works well

Actual:
Fails with "value too long for type character varying(1024)" error

Note:
password in the http_proxies table does not have a limit
password | character varying | | |

While root repository does.

upstream_password | character varying(1024) | | |
h


Related issues

Related to Katello - Bug #29931: Root repository upstream password saved in clear textClosed

Associated revisions

Revision 8c51d7b4 (diff)
Added by Piyush Tiwari 4 months ago

Fixes #30064 - encrypt long root repository upstream password (#8753)

Co-authored-by: Piyush Tiwari <>

History

#1 Updated by Partha Aji 5 months ago

  • Related to Bug #29931: Root repository upstream password saved in clear text added

#2 Updated by Partha Aji 5 months ago

  • Triaged changed from No to Yes
  • Target version set to Katello 3.16.0
  • Category set to Repositories

#3 Updated by The Foreman Bot 5 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/8753 added

#4 Updated by The Foreman Bot 4 months ago

  • Fixed in Releases Katello 4.0.0 added

#5 Updated by Piyush Tiwari 4 months ago

  • Status changed from Ready For Testing to Closed

#6 Updated by The Foreman Bot 4 months ago

  • Assignee set to Ian Ballou

#7 Updated by Bryan Kearney 2 months ago

  • Bugzilla link set to 1630536

Also available in: Atom PDF