Bug: Inconsistency between backend and frontend secretValue field validation #849

Closed
opened 2026-04-05 16:23:14 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @hart1dechu on 7/2/2024

Describe the bug

As you can see in the reproduce section, each line contains 2char + '\n' char and the complete alphabet. So each line is 29 characters (except the last one that is 28). In total i should be having 492 characters. This value is validated by the front since front only check if the current value is above 500 or not. But it doesnt pass the backend verification. In the database, secret value is encoded in OpenSSL salted, and the validation is according to that encoding, which mean after encoding my value length is far more above 500.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Project Settings'
  2. Click on 'Secrets'
  3. Create a secret value containing
01abcdefghijklmnopqrstuvwxyz
02abcdefghijklmnopqrstuvwxyz
03abcdefghijklmnopqrstuvwxyz
04abcdefghijklmnopqrstuvwxyz
05abcdefghijklmnopqrstuvwxyz
06abcdefghijklmnopqrstuvwxyz
07abcdefghijklmnopqrstuvwxyz
08abcdefghijklmnopqrstuvwxyz
09abcdefghijklmnopqrstuvwxyz
10abcdefghijklmnopqrstuvwxyz
11abcdefghijklmnopqrstuvwxyz
12abcdefghijklmnopqrstuvwxyz
13abcdefghijklmnopqrstuvwxyz
14abcdefghijklmnopqrstuvwxyz
15abcdefghijklmnopqrstuvwxyz
16abcdefghijklmnopqrstuvwxyz
17abcdefghijklmnopqrstuvwxyz
  1. See API error on char should not be more than 500

Expected behavior

It should succeed

Screenshots
As you can see, my value is able to pass front validation, but not database one

image

Deployment Type
Is this issue on SaaS (at https://oneuptime.com) or self hosted (the version that you deployed on your server)?
Self hosted

Additional context
I actually wanted to add a JWT token as a secret, but was hit by a 500char limitation. So i was trying to figure it out how to bypass that limitation just to realise, there is a frontend limitation, and a database limitation, when both of them are not sync at all

  • Why is there a limitation for character length database side ? (character varying(500) instead of text)
  • Why isn't there a way to increase that value if we want to use very long secret ?
  • Is there a workaround ?
*Originally created by @hart1dechu on 7/2/2024* **Describe the bug** As you can see in the **reproduce section**, each line contains 2char + '\n' char and the complete alphabet. So each line is 29 characters (except the last one that is 28). In total i should be having 492 characters. This value is validated by the front since front only check if the current value is above 500 or not. But it doesnt pass the backend verification. In the database, secret value is encoded in OpenSSL salted, and the validation is according to that encoding, which mean after encoding my value length is far more above 500. **To Reproduce** Steps to reproduce the behavior: 1. Go to 'Project Settings' 2. Click on 'Secrets' 3. Create a secret value containing ``` 01abcdefghijklmnopqrstuvwxyz 02abcdefghijklmnopqrstuvwxyz 03abcdefghijklmnopqrstuvwxyz 04abcdefghijklmnopqrstuvwxyz 05abcdefghijklmnopqrstuvwxyz 06abcdefghijklmnopqrstuvwxyz 07abcdefghijklmnopqrstuvwxyz 08abcdefghijklmnopqrstuvwxyz 09abcdefghijklmnopqrstuvwxyz 10abcdefghijklmnopqrstuvwxyz 11abcdefghijklmnopqrstuvwxyz 12abcdefghijklmnopqrstuvwxyz 13abcdefghijklmnopqrstuvwxyz 14abcdefghijklmnopqrstuvwxyz 15abcdefghijklmnopqrstuvwxyz 16abcdefghijklmnopqrstuvwxyz 17abcdefghijklmnopqrstuvwxyz ``` 4. See API error on char should not be more than 500 **Expected behavior** It should succeed **Screenshots** As you can see, my value is able to pass front validation, but not database one ![image](https://github.com/OneUptime/oneuptime/assets/65031990/28f0022a-9503-44a5-81d6-1c23cc3ed5a9) **Deployment Type** Is this issue on SaaS (at https://oneuptime.com) or self hosted (the version that you deployed on your server)? Self hosted **Additional context** I actually wanted to add a JWT token as a secret, but was hit by a 500char limitation. So i was trying to figure it out how to bypass that limitation just to realise, there is a frontend limitation, and a database limitation, when both of them are not sync at all - Why is there a limitation for character length database side ? (character varying(500) instead of text) - Why isn't there a way to increase that value if we want to use very long secret ? - Is there a workaround ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#849