OpenCTI-Platform / opencti

Open Cyber Threat Intelligence Platform
https://opencti.io
Other
6.29k stars 929 forks source link

Uploading a PDF threat report results in "Cannot read property 'toLowerCase' of null" error #432

Closed graememeyer closed 4 years ago

graememeyer commented 4 years ago

Please replace every line in curly brackets { like this } with an appropriate answer, and remove this line.

Description

{ I've tried to upload a PDF (threat report) in my new Docker install and I'm getting this error:

opencti_1 | error: [OPENCTI] Technical error > Cannot read property 'toLowerCase' of null {"locations":[{"line":4,"column":3}],"path":["uploadImport"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"stacktrace":["TypeError: Cannot read property 'toLowerCase' of null"," at b (/opt/opencti/build/index.js:1:68149)"," at runMicrotasks ()"," at processTicksAndRejections (internal/process/task_queues.js:93:5)"," at async /opt/opencti/build/index.js:1:716965"]}}}}

Environment

  1. OS (where OpenCTI server runs): { Ubuntu 18 LTS. }
  2. OpenCTI version: { 2.1.3 }
  3. OpenCTI client: { Web GUI }
  4. Other environment details: Clean install of Ubuntu 18 LTS with docker engine and docker ce.

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. { Create a new threat report }
  2. { Click Data Import in the top right }
  3. { Click the "Select your file button" }
  4. { Upload the PDF}
  5. { See "An unknown error has occurred! Please try again later." in the web GUI"}
  6. { See the above large error in the cmdline }

Expected Output

{ Threat report is uploaded to OpenCTI and a success message or a new page is displayed in the web gui }

Actual Output

{ See "An unknown error has occurred! Please try again later." in the web GUI." } {See the this large error in the cmdline: error: [OPENCTI] Technical error > Cannot read property 'toLowerCase' of null {"locations":[{"line":4,"column":3}],"path":["uploadImport"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"stacktrace":["TypeError: Cannot read property 'toLowerCase' of null"," at b (/opt/opencti/build/index.js:1:68149)"," at runMicrotasks ()"," at processTicksAndRejections (internal/process/task_queues.js:93:5)"," at async /opt/opencti/build/index.js:1:716965"]}}}}

Additional Information

{ This is the PDF I tried to upload: https://paper.seebug.org/papers/APT/APT_CyberCriminal_Campagin/2014/2014.05.28.NewsCaster_An_Iranian_Threat_Within_Social_Networks/file-2581720763-pdf.pdf }

graememeyer commented 4 years ago

Fantastically quick response. Impressive ❤️