snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.88k stars 3.14k forks source link

Input validation in custom fields always giving "invalid format" when encrypting the field #10074

Open Stingray71 opened 3 years ago

Stingray71 commented 3 years ago

Debug mode

Describe the bug

When creating a custom field, and encrypting it, it always gives "Format invalid" when you put something in the field and try to save the page. I had this occur to my mainly with IP, IPV4 and custom regex.

When I do not encrypt the field, it accepts the IP input, IP, IPV4 and the regex commands. But it seems to happen when limiting to "alpha" as well.

I assume t encrypts before it checks the validation?

Kr,

Dirk

Reproduction steps

  1. Create custom field
  2. Select IP, IPV4 or custom regex (in this case add the IPV4 regex line)
  3. Check the encrypt field box.
  4. Save
  5. Go to the input page and put in any valid IP range in the field.
  6. Enjoy the error message :) ...

Expected behavior

Considering I entered a valid IP address I expected the value to be correct and accepted.

Screenshots

No response

Snipe-IT Version

Version v5.1.8 - build 6227 (master)

Operating System

Docker container

Web Server

Laravel 6

PHP Version

Provided version in docker container install

Operating System

Win10

Browser

Chrome

Version

latest

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

Installed in a Docker container

welcome[bot] commented 3 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

snipe commented 3 years ago

Have you tried updating to 5.2.0?

Stingray71 commented 3 years ago

We have the latest update available atm. Version v5.2.0 - build 6339 (master) It won't let me upload a screenshot, even though it is a jpeg format. So this is the text: TestIpAdress 192.168.20.10 The testipadress 22 must be a valid IP address.

Stingray71 commented 3 years ago

I have the latest version I think: Version v5.2.0 - build 6339 (master) This is the text it gives me: TestIpAdress 192.168.20.10 The testipadress 22 must be a valid IP address.

PLA7IN commented 1 week ago

I have this problem too with: Snipe-IT version: v7.0.11 build 15044 (g46ed07642) PHP Version: 8.1.2-1ubuntu2.18 Laravel Version: 10.48.14

I tried this additionally on the official Snipe-IT-Demo, with the same error. It would be nice to see this fixed, so I can save BitLocker Passphrases or BIOS passwords for our Assets.