<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> <dfn><code class="MIME" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">application/postscript</anchor></code></dfn> は、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PostScript</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">プログラム</anchor>を表す <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">MIME型</anchor>です <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2</anchor-internal></src>。</p><section><h1>仕様書</h1><refs xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><ul xmlns="http://www.w3.org/1999/xhtml"><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <cite xml:lang="en">RFC 2046 - Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</cite> (<time>2015-03-22 13:14:46 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/rfc2046#section-4.5.2">http://tools.ietf.org/html/rfc2046#section-4.5.2</anchor-external></li></ul></refs></section><section><h1>意味</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <code class="MIME" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">application/postscript</anchor></code> が規定された時点で
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PostScript</anchor> には水準1と水準2がありますが <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2</anchor-internal></src>、どちらにも使えます。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PostScript</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">DSC</anchor> (<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">document structuring conventions</anchor>) は必須ではありませんが、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">相互運用性</anchor>のため強く推奨されています <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PostScript</anchor> は <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Adobe Systems, Inc.</anchor> の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">登録商標</anchor>であり、
<code class="MIME" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">application/postscript</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">MIME型</anchor>を使うことは、
本<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">商標</anchor>とそれにより課されるすべての権利を<rubyb xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">認識<rt xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">recognition</rt></rubyb>することを暗示しています <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2</anchor-internal></src>。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> それが具体的に何を求めているのかは謎です。</comment-p><hr></hr><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="18" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[18]</anchor-end> 
<code>.ai</code> ファイルに使われることがあります。 
<sw-see xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"> <anchor>CKAN資源</anchor> </sw-see></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="19" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[19]</anchor-end> 
この用法の妥当性は疑問です。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="20" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[20]</anchor-end> 
現在の <code>.ai</code> ファイル形式は <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PDF</anchor> に独自データを加えたものです。
<sw-see xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"> <anchor>.ai</anchor> </sw-see>
ということは広い意味で <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PDF</anchor> も一応 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PostScript</anchor> ということで
<code>.ai</code> を <code>application/postscript</code> だと言い張ることも不可能ではないのかもしれませんが...</p></section><section><h1>処理</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> 一般目的の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PostScript</anchor> 解釈器にデータを引き渡すと、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">セキュリティー</anchor>上の問題を引き起こすことがあります。
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">MIME</anchor> の実装は次のような点に注意する必要があります。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2</anchor-internal></src><figure class="list"><ul><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> <code><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">deletefile</anchor></code> などファイル操作の演算があります。
送信者は避けるべきですし、受信者は危険な操作を無効にするか、
特権を持たせないよう注意するべきです。</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end> 通常の解釈器などを終了させる演算があり、「外側」の環境への変更が残ったまま次の文書が処理されることになるかもしれません。
従って<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">サービス拒否攻撃</anchor>となる危険性があります。
送信者はそうした操作に依存するべきではありませんし、
受信者は <code><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">startjob</anchor></code> や <code><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">exitserver</anchor></code>
の操作を除去したり無効化したりして変更が環境に残らないようにするべきです。</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[11]</anchor-end> <code><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">setsystemparams</anchor></code> などシステムや<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">装置</anchor>の引数を変更する演算があります。
送信者はそうしたものが正しく動作することに依存するべきではありませんし、
受信者は変更を無効化するべきです。</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> 実装によっては非標準ながら<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">機械</anchor>コードの直接実行機能があります。
送信者は使うべきではありませんし、受信者は実行するべきではありません。</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> 送信者は非標準の拡張を使うべきではありませんし、
受信者は危険がないようにするべきです。</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[14]</anchor-end> システムの<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">資源</anchor>を大量に消費したり、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">無限ループ</anchor>に陥ったりするかもしれません。
送信者はそのようなものを避けるべきですし、
受信者は十分な時間が経過した処理を中断する仕組みを提供するべきです。
またシステムの<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">資源</anchor>の消費量を制限するべきです。</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="15" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[15]</anchor-end> 生の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">バイナリー</anchor>データを含めることができますが、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">インターネットメール</anchor>では推奨されていません。</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="16" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[16]</anchor-end> 解釈器の不具合により受信者のシステムを操作できるかもしれません。</li></ul></figure></p></section><section><h1>歴史</h1><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> RFC 2046 4.5.2.  PostScript Subtype <ins>PostScript 亜型</ins></figcaption><blockquote><p>A media type of &quot;application/postscript&quot; indicates a PostScript
program.  Currently two variants of the PostScript language are
allowed; the original level 1 variant is described in [POSTSCRIPT]
and the more recent level 2 variant is described in [POSTSCRIPT2].</p></blockquote><p>媒体型 &quot;application/postscript&quot; は <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PostScript</anchor>
プログラムを示します。現在 PostScript 言語は2種類が認められます。
元の水準1は [POSTSCRIPT] で説明されています。
比較的新しい水準2は [POSTSCRIPT2] で説明されています。</p><blockquote><p>PostScript is a registered trademark of Adobe Systems, Inc.  Use of
the MIME media type &quot;application/postscript&quot; implies recognition of
that trademark and all the rights it entails.</p></blockquote><p>PostScript は <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Adobe</anchor> Systems, Inc. の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">登録商標</anchor>です。 MIME
媒体型 &quot;application/postscript&quot; 
の使用は、この商標とそれに伴う全ての権利を認識することを必要とします。</p><blockquote><p>The PostScript language definition provides facilities for internal
labelling of the specific language features a given program uses.
This labelling, called the PostScript document structuring
conventions, or DSC, is very general and provides substantially more
information than just the language level.  The use of document
structuring conventions, while not required, is strongly recommended
as an aid to interoperability.  Documents which lack proper
structuring conventions cannot be tested to see whether or not they
will work in a given environment.  As such, some systems may assume
the worst and refuse to process unstructured documents.</p></blockquote><p>PostScript 言語定義は当該プログラムが使う特定言語機能の内部札付け機能を用意しています。この札付けは
PostScript 文書構造協定 <ins>日本語定訳ありますか?</ins>, DSC 
と呼ばれますが、これは非常に一般的で本質的に単なる言語層以上の情報を提供するものです。
文書構造協定の使用は、必須ではありませんが、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">相互通信性</anchor>の向上のために強く推奨します。
適切な構造協定のない文書は当該環境で機能するかどうかを試験することが出来ません。
ですから、構造協定のない文書を最悪とみなして処理するのを拒む処理系があります。</p><blockquote><p>The execution of general-purpose PostScript interpreters entails
serious security risks, and implementors are discouraged from simply
sending PostScript bodies to &quot;off-the-shelf&quot; interpreters.  While it
is usually safe to send PostScript to a printer, where the potential
for harm is greatly constrained by typical printer environments,
implementors should consider all of the following before they add
interactive display of PostScript bodies to their MIME readers.</p></blockquote><p>一般目的の PostScript 解釈器の実行は重大な安全上の危険を伴うので、実装者には
PostScript <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">本体</anchor>を単純に
「off-the-shelf」<ins>なんて訳せばいいでしょ?</ins>解釈器に送ってしまわないことを推奨します。通常、 PostScript 
を印刷機に送ることは、害する可能性を典型的な印刷機環境は強く抑制してしまうので安全ですが、実装者は
PostScript 本体を MIME 読者に対話型表示する前に次の全てを考慮するのが良いです。</p><blockquote><p>The remainder of this section outlines some, though probably not all,
of the possible problems with the transport of PostScript entities.</p></blockquote><p>この節の残りの部分では、 PostScript <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">実体</anchor>の転送に伴い起こり得る問題の,
おそらく全てではありませんが幾つかを概説します。</p><pre>    (1)   Dangerous operations in the PostScript language
          include, but may not be limited to, the PostScript
          operators &quot;deletefile&quot;, &quot;renamefile&quot;, &quot;filenameforall&quot;,
          and &quot;file&quot;.  &quot;File&quot; is only dangerous when applied to
          something other than standard input or output.
          Implementations may also define additional nonstandard
          file operators; these may also pose a threat to
          security. &quot;Filenameforall&quot;, the wildcard file search
          operator, may appear at first glance to be harmless.</pre><pre>          Note, however, that this operator has the potential to
          reveal information about what files the recipient has
          access to, and this information may itself be
          sensitive.  Message senders should avoid the use of
          potentially dangerous file operators, since these
          operators are quite likely to be unavailable in secure
          PostScript implementations.  Message receiving and
          displaying software should either completely disable
          all potentially dangerous file operators or take
          special care not to delegate any special authority to
          their operation.  These operators should be viewed as
          being done by an outside agency when interpreting
          PostScript documents.  Such disabling and/or checking
          should be done completely outside of the reach of the
          PostScript language itself; care should be taken to
          insure that no method exists for re-enabling full-
          function versions of these operators.</pre><pre>    (2)   The PostScript language provides facilities for exiting
          the normal interpreter, or server, loop.  Changes made
          in this &quot;outer&quot; environment are customarily retained
          across documents, and may in some cases be retained
          semipermanently in nonvolatile memory.  The operators
          associated with exiting the interpreter loop have the
          potential to interfere with subsequent document
          processing.  As such, their unrestrained use
          constitutes a threat of service denial.  PostScript
          operators that exit the interpreter loop include, but
          may not be limited to, the exitserver and startjob
          operators.  Message sending software should not
          generate PostScript that depends on exiting the
          interpreter loop to operate, since the ability to exit
          will probably be unavailable in secure PostScript
          implementations.  Message receiving and displaying
          software should completely disable the ability to make
          retained changes to the PostScript environment by
          eliminating or disabling the &quot;startjob&quot; and
          &quot;exitserver&quot; operations.  If these operations cannot be
          eliminated or completely disabled the password
          associated with them should at least be set to a hard-
          to-guess value.</pre><pre>    (3)   PostScript provides operators for setting system-wide
          and device-specific parameters.  These parameter
          settings may be retained across jobs and may
          potentially pose a threat to the correct operation of
          the interpreter.  The PostScript operators that set
          system and device parameters include, but may not be
          limited to, the &quot;setsystemparams&quot; and &quot;setdevparams&quot;
          operators.  Message sending software should not
          generate PostScript that depends on the setting of
          system or device parameters to operate correctly.  The
          ability to set these parameters will probably be
          unavailable in secure PostScript implementations.
          Message receiving and displaying software should
          disable the ability to change system and device
          parameters.  If these operators cannot be completely
          disabled the password associated with them should at
          least be set to a hard-to-guess value.</pre><pre>    (4)   Some PostScript implementations provide nonstandard
          facilities for the direct loading and execution of
          machine code.  Such facilities are quite obviously open
          to substantial abuse.  Message sending software should
          not make use of such features.  Besides being totally
          hardware-specific, they are also likely to be
          unavailable in secure implementations of PostScript.
          Message receiving and displaying software should not
          allow such operators to be used if they exist.</pre><pre>    (5)   PostScript is an extensible language, and many, if not
          most, implementations of it provide a number of their
          own extensions.  This document does not deal with such
          extensions explicitly since they constitute an unknown
          factor.  Message sending software should not make use
          of nonstandard extensions; they are likely to be
          missing from some implementations.  Message receiving
          and displaying software should make sure that any
          nonstandard PostScript operators are secure and don't
          present any kind of threat.</pre><pre>    (6)   It is possible to write PostScript that consumes huge
          amounts of various system resources.  It is also
          possible to write PostScript programs that loop
          indefinitely.  Both types of programs have the
          potential to cause damage if sent to unsuspecting
          recipients.  Message-sending software should avoid the
          construction and dissemination of such programs, which
          is antisocial.  Message receiving and displaying
          software should provide appropriate mechanisms to abort
          processing after a reasonable amount of time has
          elapsed. In addition, PostScript interpreters should be
          limited to the consumption of only a reasonable amount
          of any given system resource.</pre><pre>    (7)   It is possible to include raw binary information inside
          PostScript in various forms.  This is not recommended
          for use in Internet mail, both because it is not
          supported by all PostScript interpreters and because it
          significantly complicates the use of a MIME Content-
          Transfer-Encoding.  (Without such binary, PostScript
          may typically be viewed as line-oriented data.  The
          treatment of CRLF sequences becomes extremely
          problematic if binary and line-oriented data are mixed
          in a single Postscript data stream.)</pre><pre>    (8)   Finally, bugs may exist in some PostScript interpreters
          which could possibly be exploited to gain unauthorized
          access to a recipient's system.  Apart from noting this
          possibility, there is no specific action to take to
          prevent this, apart from the timely correction of such
          bugs if any are found.</pre></figure></section><section><h1>関連</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[17]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PDF</anchor> 用には <code class="MIME" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">application/pdf</anchor></code> があります。</p></section><section><h1>メモ</h1></section></body></html>