Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-23513

Integer "corruption" in javascript preprocessing

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 7.0.0alpha5
    • Proxy (P), Server (S)
    • None
    • Debian 12

      Javascript internally uses float64 to represent integers.

      This intentional design flaw corrupts big numbers in Javascript preprocessing.

       

      Simple preprocessing example: "return 123456789123456789".

      You expect 123456789123456789 ? Wrong! It is 123456789123456780.

       

      For this to bite, javascript must convert input string to number.

      Unfortunately this happens whenever you edit JSON by javascript:

      Script: "var data=JSON.parse(value); return JSON.stringify(data)"

      Input: "{"victim": 123456789123456789}"

      Output: "{"victim":123456789123456780}"

       

      For monitoring servers its probably OK if petabyte storage is few bytes off,

      but when we get creative, things may corrupt - and it will be completely silent.

            neogan Andrei Gushchin (Inactive)
            user185953 user185953
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: