-
Notifications
You must be signed in to change notification settings - Fork 0
Directive: object src
The object-src
directive specifies valid sources for the <object>, <embed>, and <applet> elements. This was originally paired with plugin-types to determine which media types (née mime types) were permitted.
As of 2023, no browser supports traditional plugins anymore (browser "extensions" are a completely different thing). However, browsers continue have support for the PDF format, which used to require a plugin. If PDF files can be displayed inline then application/pdf
and text/pdf
content is allowed, as per the HTML specification.
Caution
Elements controlled by object-src
are perhaps coincidentally considered legacy HTML elements and aren't receiving new standardized features (such as the security attributes sandbox or allow for <iframe>). Therefore it is recommended to restrict this by explicitly setting object-src 'none'
.
Affects: <object>; <embed>; <applet>
Required reading:
Accepts one or more schemes or hosts, the 'self'
keyword, or the 'none'
keyword.
object-src 'none'
object-src 'self'
object-src example.com
object-src example.com example.org
object-src https://*.example.com
object-src https:
✅ object-src
will fallback to default-src
if it is undefined.
-
CSP-0100 — [ERROR] directive
%s
has an invalid value%s
ABNF (CSP3)
directive-name = "object-src"
directive-value = serialized-source-list
See ABNF: serialized-source-list
- source-list in CSP2
- serialized-source-list in CSP3
Content licensed under CC BY-SA.
- 🧪 Experimental, with limited support
⚠️ Important notes on usage- 🚫 Deprecated or obsolete
- base-uri
- block-all-mixed-content 🚫
- child-src
- connect-src
- default-src
- fenced-frame-src 🧪
- font-src
- form-action
- frame-ancestors
- frame-src
- img-src
- manifest-src
- media-src
- navigate-to 🚫
- object-src
- plugin-types 🚫
- prefetch-src 🚫
- referrer 🚫
- report-to 🧪
-
report-uri
⚠️ - require-trusted-types-for 🧪
- sandbox
- script-src-attr
- script-src-elem
- script-src
- style-src-attr
- style-src-elem
- style-src
- trusted-types 🧪
- upgrade-insecure-requests
- webrtc
- worker-src