HTTP CSP object-src Directive

Die Content-Security-Policy object-src Direktive kontrolliert erlaubte Quellen für Plugin-Content via <object>, <embed> und <applet> Elemente. Sie verhindert Flash-Exploits, Legacy-Plugin-Attacks und Drive-by-Downloads durch Einschränkung oder vollständiges Verbot von Browser-Plugins.

Typ

CSP Fetch-Direktive

Syntax

Die Direktive akzeptiert eine Whitelist vertrauenswürdiger Plugin-Quellen.

http
Content-Security-Policy: object-src 'none'
Content-Security-Policy: object-src 'self' https://trusted-plugins.example.com

Direktiven

Die object-src Direktive verwendet Standard-CSP-Quellausdrücke zur Kontrolle erlaubter Plugin-Ressourcen.

'none'
Verbietet alle Plugins. Best-Practice für moderne Webanwendungen ohne Legacy-Plugin-Dependencies.
'self'
Erlaubt Plugins nur vom gleichen Origin. Nützlich für kontrollierte Plugin-Environments.
https://plugins.example.com
Domain-Whitelisting. Erlaubt gezielt Plugins von vertrauenswürdigen Sources.
https:
Erlaubt alle HTTPS-Plugin-Quellen. Erzwingt verschlüsselte Übertragung.

Beispiele

Nachfolgend finden Sie praktische Anwendungsbeispiele für die object-src Direktive.

Beispiel 1 Moderne Webapp ohne Plugins

http
HTTP/1.1 200 OK
Content-Security-Policy: object-src 'none'

<!DOCTYPE html>
<html>
<body>
  <h1>Modern API Dashboard</h1>
  <!-- Keine Flash- oder Java-Applets benötigt -->

  <object data="https://malicious.com/exploit.swf">
    <!-- Blockiert durch CSP -->
  </object>

  <embed src="/legacy/plugin.swf" type="application/x-shockwave-flash">
    <!-- Blockiert durch CSP -->
  </embed>
</body>
</html>

Beispiel 2 Legacy-System mit kontrollierten Plugins

http
Content-Security-Policy: object-src 'self'

<!-- Legacy-Applikation mit internen Plugins -->
<object data="/viewer/pdf-viewer.swf" type="application/x-shockwave-flash">
  <param name="src" value="/documents/report.pdf">
  <!-- Erlaubt: Self-hosted Plugin -->
</object>

<embed src="https://external-plugins.com/viewer.swf">
  <!-- Blockiert: Externe Quelle -->
</embed>

Beispiel 3 PDF Viewer mit Whitelisting

http
Content-Security-Policy: object-src 'self' https://cdn.pdfjs.org; default-src 'self'

<!-- PDF-Viewer Integration -->
<object data="https://cdn.pdfjs.org/viewer.html" type="text/html">
  <param name="file" value="/documents/api-spec.pdf">
  <!-- Erlaubt: Whitelisted PDF.js CDN -->
</object>

Plugin Security Flow

CSP object-src verhindert Flash-Exploits und Plugin-Attacks

Vorteile für die Systemarchitektur

  • Flash-Exploit-Prävention: Verhindert bekannte Flash-Sicherheitslücken durch vollständiges Verbot von Flash-Content via object-src none
  • Drive-by-Download-Schutz: Blockiert automatische Malware-Downloads die über manipulierte Plugin-Dateien ausgeführt werden würden
  • Legacy-Modernisierung: Erzwingt Migration von unsicheren Browser-Plugins zu modernen Web-Standards wie HTML5 Canvas oder WebAssembly

Spezifikation

Content Security Policy Level 3 – W3C Working Draft https://www.w3.org/TR/CSP3/#directive-object-src

Weitere Spezifikationen

CSP default-src Directive, Content-Security-Policy Header