Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • R ROBERT Server
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Attention une mise à jour du service Gitlab va être effectuée le mardi 07 février entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes (habituellement de l'ordre de trois minutes).

  • TousAntiCovid sources
  • ROBERT Server
  • Issues
  • #42
Closed
Open
Issue created Jun 05, 2020 by anssi-user-58@user58

Null pointers should not be dereferenced

The following bug report has been received through the YesWeHack public bug bounty phase.

Acknowledgements: Vincent LOUIS - Linty Services

The following report refers to this code: https://gitlab.inria.fr/stopcovid19/robert-server/-/blob/08db030b079c481b4e68c785466a953403dcd4e4/robert-server-common/src/main/java/fr/gouv/stopc/robert/server/common/utils/ByteUtils.java#L44

A reference to null should never be dereferenced/accessed. Doing so will cause a NullPointerException to be thrown. At best, such an exception will cause abrupt program termination. At worst, it could expose debugging information that would be useful to an attacker, or it could allow an attacker to bypass security measures.

 public static byte[] addAll(byte[] a, byte[] b) {
        if (a == null) {
            byte[] copy = new byte[b.length]; // ANSSI comment: maybe check "b" here as well
            System.arraycopy(b, 0, copy, 0, b.length); 
            return copy;
        } else if (b == null) {
            byte[] copy = new byte[a.length]; 
            System.arraycopy(a, 0, copy, 0, a.length); 
        }

        byte[] res = new byte[a.length + b.length]; // A "NullPointerException" could be thrown; "b" is nullable here
        System.arraycopy(a, 0, res, 0, a.length);
        System.arraycopy(b, 0, res, a.length, b.length);
        return res;
    }

ANSSI comment:

A quick look at the same Utils file shows other helper functions might suffer from the same issue (bytesToLong, bytesToInt, convertEpoch24bitsToInt), depending on calling context / assumptions.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking