3.4.3.4 Using Content Security Policy (CSP) in APEX
Learn how to configure CSP for an application.
APEX supports CSP through the use of HTTP response headers. Enabling CSP at the application-level ensures that your entire application adheres to strict resource loading rules, helping you build more secure and robust applications.
- Enabling CSP in an Application
Enable CSP for an application by editing Security Attributes. - About Content-Security-Policy and Content-Security-Policy-Report-Only
Learn aboutContent-Security-Policy
andContent-Security-Policy-Report-Only
headers. - Supported Substitution Strings
Learn about supported substitution strings for CSP headers.
Parent topic: Configuring Content Security Policy (CSP)
3.4.3.4.1 Enabling CSP in an Application
Enable CSP for an application by editing Security Attributes.
Oracle APEX supports CSP through the use of HTTP response headers. Enabling CSP at the application-level ensures that your entire application adheres to strict resource loading rules, helping you build more secure and robust applications.
To enable CSP in an APEX application:
Parent topic: Using Content Security Policy (CSP) in APEX
3.4.3.4.2 About Content-Security-Policy and Content-Security-Policy-Report-Only
Learn about Content-Security-Policy
and
Content-Security-Policy-Report-Only
headers.
When implementing Content Security Policy (CSP) header, you can
choose between Content-Security-Policy
and
Content-Security-Policy-Report-Only
headers.
Once you add a CSP header:
-
CSP is applied globally across your application.
-
Only resources that match the specified policy are allowed to load.
-
Any scripts or resources that are not explicitly permitted (for example, inline scripts without the proper nonce/hash) are blocked by the browser.
Tip:
This may initially cause certain features (or plug-ins) to break if they are not CSP-compliant, so testing and adaptation may be required.
By enabling CSP, you are taking an important step toward hardening your application against client-side attacks. It enforces best practices and ensures that your codebase remains clean, secure, and trustworthy.
Parent topic: Using Content Security Policy (CSP) in APEX
3.4.3.4.3 Supported Substitution Strings
Learn about supported substitution strings for CSP headers.
Available substitution strings for CSP header include:
#APEX_CSP_NONCE#
- Used for the HTTP header and resolves to the current page request nonce value (for example,'nonce-random123'
. Used for allowing inline scripts and styles with a nonce.#APEX_CSP_HASHES#
- Resolves to the hashes of approved inline scripts or styles.#APEX_DISPLAY_NONE#
- Resolves todisplay: none
to hide elements dynamically. Commonly used to manage visibility before content is fully loaded.#APEX_CSP_NONCE_ATTRIBUTE#
- The html attribute containing the nonce value (for example,nonce="random123"
.#APEX_CSP_NONCE_VALUE#
- The exact nonce value.
Parent topic: Using Content Security Policy (CSP) in APEX