os_safari_javascript_enabled not detected properly #145

Closed
opened 2026-01-19 18:29:23 +00:00 by michael · 0 comments
Owner

Originally created by @patgmac on GitHub.

The check for os_safari_javascript_enabled , which is:

/usr/bin/profiles -P -o stdout | /usr/bin/grep -c 'WebKitPreferences.javaScriptEnabled = 1' | /usr/bin/awk '{ if ($1 >= 1) {print "1"} else {print "0"}}'

is not working because it needs to be:

/usr/bin/profiles -P -o stdout | /usr/bin/grep -c '"WebKitPreferences.javaScriptEnabled" = 1' | /usr/bin/awk '{ if ($1 >= 1) {print "1"} else {print "0"}}' (notice double quotes around WebKitPreferences.javaScriptEnabled )

This is working in the other WebKitPreferences.* prefs.
--->

Summary

(Summarize the bug encountered concisely)

Steps to reproduce

Operating System version

macOS 14.0

Intel or Apple Silicon

Apple Silicon

What is the current bug behavior?

Control always reports failure.

What is the expected correct behavior?

(What you should see instead)

Relevant logs and/or screenshots

(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.)

Output of checks

(Paste any output that occurs with the bug)

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)
b1a5d8956e/rules/os/os_safari_javascript_enabled.yaml (L6)

Originally created by @patgmac on GitHub. The check for os_safari_javascript_enabled , which is: `/usr/bin/profiles -P -o stdout | /usr/bin/grep -c 'WebKitPreferences.javaScriptEnabled = 1' | /usr/bin/awk '{ if ($1 >= 1) {print "1"} else {print "0"}}' ` is not working because it needs to be: `/usr/bin/profiles -P -o stdout | /usr/bin/grep -c '"WebKitPreferences.javaScriptEnabled" = 1' | /usr/bin/awk '{ if ($1 >= 1) {print "1"} else {print "0"}}' `(notice double quotes around WebKitPreferences.javaScriptEnabled ) This is working in the other WebKitPreferences.* prefs. ---> ### Summary (Summarize the bug encountered concisely) ### Steps to reproduce ### Operating System version macOS 14.0 ### Intel or Apple Silicon Apple Silicon ### What is the current *bug* behavior? Control always reports failure. ### What is the expected *correct* behavior? (What you should see instead) ### Relevant logs and/or screenshots (Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.) ### Output of checks (Paste any output that occurs with the bug) ### Possible fixes (If you can, link to the line of code that might be responsible for the problem) https://github.com/usnistgov/macos_security/blob/b1a5d8956e92798e419897f7b1c9404a2f2eadff/rules/os/os_safari_javascript_enabled.yaml#L6
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: usnistgov/macos_security#145