ZupIT / horusec

Horusec is an open source tool that improves identification of vulnerabilities in your project with just one command.

Home Page:https://horusec.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Internal Server Error

gustavocuozzo opened this issue · comments

What happened:

horusec cli:

ERRO[0037] [HORUSEC] something went wrong while sending analysis to horusec -> {"code":500,"status":"Internal Server Error","content":"{ERROR_HTTP} something went wrong, sorry for the inconvenience"} 

horusec-api:

horusec-api              | 2022/11/12 17:18:07 /home/runner/go/pkg/mod/github.com/!zup!i!t/horusec-devkit@v1.0.21/pkg/services/database/database.go:139 ERROR: invalid byte sequence for encoding "UTF8": 0x00 (SQLSTATE 22021)

horusec-api              | [0.323ms] [rows:0] INSERT INTO "vulnerabilities ("vulnerability_id","line","column","confidence","file","code","details","security_tool","language","severity","type","commit_author","commit_email","commit_hash","commit_message","commit_date","vuln_hash") VALUES ('15a43c2c-77c8-4cdd-a11b-eaa26c3d8bcb','125','11','MEDIUM','****','-----BEGIN CERTIFICATE----------END CERTIFICATE-----%s/%s, %sSSL Client%sSSL Server%sEmail%s','(1/1) * Possible vulnerability detected: Asymmetric Private Key

horusec-api              | time="2022-11-12T17:18:07Z" level=error msg="{INTERNAL_SERVER_ERROR} ->" error="ERROR: invalid byte sequence for encoding \"UTF8\": 0x00 (SQLSTATE 22021)"

horusec-api              | 2022/11/12 17:18:07 "POST http://0.0.0.0:8000/api/analysis HTTP/1.1" from 172.20.0.1:43492 - 500 131B in 51.072979ms

The file name has been omitted.

What you expected to happen:
Horusec web management show metrics

Environment:

  • Horusec version (use horusec version):
Version:          v2.8.0
Git commit:       df32c1ce03d2de748cecb76cff383f2851e198c3
Built:            Wed Jun 08 13:57:08 2022
Distribution:     normal
  • Others:
Docker version 20.10.12
docker-compose version 1.28.2
horusec-platform v2.18.0

it looks like the target file contains a null character which impacts encoding error when storing into DB. You need to double-check that there are no binary files scanned and if there are any binary files scanned then they should be excluded in horusec config.

thanks, I removed the files in horusec configuration