Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6662415

Registry key shouldn't be opened with KEY_WRITE flag if only read is required

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 9
    • 6u10, 8, 9
    • install
    • None
    • x86
    • windows_xp

      This problem was found by code inspection and there's no testcase currently to show any failure. In general, the KEY_WRITE flag shouldn't be used if opening a registry key for reading only. On Vista, writing a registry key under the HKLM branch requires a proecess with high integrity. So a process with integrity below the high level will fail when trying to open a registry key under the HKLM branch with KEY_WRITE flag on Vista.

      The GetLatestJavaKey() function in RegCommon.cpp has this problem.
      All the registry keys in that method should be opened with the KEY_READ flag only.

      Please also check other registry related code in regutils and regutilsmsi for this kind of issue.

            asemenyuk Alexey Semenyuk
            ccheung Calvin Cheung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: