greenbone / gsa

Greenbone Security Assistant - The web frontend for the Greenbone Community Edition
GNU Affero General Public License v3.0
215 stars 95 forks source link

Unable to save user preferences #890

Closed michael-markevich closed 6 years ago

michael-markevich commented 6 years ago

Expected behavior

User settings at https://server/usersettings can be edited and saved.

Current behavior

When trying to save settings, "Unknown Error" message is displayed. The settings are apparently not saved.

Steps to reproduce

  1. Navigate to Extras / My settings
  2. Change any setting or even
  3. Receive "Unknown Error" message.
  4. Nothing shows up in log messages even with debug settings.

GVM versions

gsa: (gsad --version) Today's snapshot from Github.

gvm: (gvmd --version) Today's snapshot from Github.

openvas-scanner: (openvassd --version) Today's snapshot from Github.

gvm-libs: Today's snapshot from Github.

openvas-smb: none.

Environment

Operating system: Debian Stretch.

Installation method / source: (packages, source installation) Built from source with Postgres backend enabled (9.6).

Logfiles

bjoernricks commented 6 years ago

Could you take a look at the browsers console and the gmp http post request with cmd=save_my_settings at the network tab?

michael-markevich commented 6 years ago

POST https://server/gmp 400 (Bad Request) (anonymous) @ http.js:186 value @ http.js:146 value @ http.js:58 value @ users.js:213 value @ usersettingspage.js:238 value @ savedialog.js:68 onClick @ savedialog.js:139 s @ withClickHandler.js:46 a @ react-dom.production.min.js:15 invokeGuardedCallback @ react-dom.production.min.js:16 invokeGuardedCallbackAndCatchFirstError @ react-dom.production.min.js:16 u @ react-dom.production.min.js:20 p @ react-dom.production.min.js:22 m @ react-dom.production.min.js:22 f @ react-dom.production.min.js:21 v @ react-dom.production.min.js:24 g @ react-dom.production.min.js:24 Fe @ react-dom.production.min.js:88 br @ react-dom.production.min.js:222 J @ react-dom.production.min.js:44 Ue @ react-dom.production.min.js:89 yr @ react-dom.production.min.js:223 Xe @ react-dom.production.min.js:89

michael-markevich commented 6 years ago

gsad_request_400.txt

bjoernricks commented 6 years ago

The gmp request

<modify_setting setting_id="7eda49c5-096c-4bef-b1ab-d080d87300df">
<value></value>
</modify_setting>

is failing. The UUID 7eda49c5-096c-4bef-b1ab-d080d87300df is the setting for the default severity. So it seems that gsa is sending an empty default severity. Could you check your user setting for the default severity?

michael-markevich commented 6 years ago

These are default settings (as I could not set anything else):

Severity Class | NVD Vulnerability Severity Ratings Dynamic Severity | No Default Severity | 10.0

If I change default severity to any other smaller value, it will be saved correctly (f.ex. 9.9 or 9.8... ). Setting 0.0 also produces the same "Unknown Error", as with default 10.0.

bjoernricks commented 6 years ago

Thanks for the info! I'll check why 0 and 10 don't work in the next weeks.

swaterkamp commented 6 years ago

I did a quick check and it seems that not only 0 and 10 won't work, but also all natural numbers in between. So every number without a decimal place causes Unknown Error.