| 1659 |
#en |
#en |
| 1660 |
The table used by the above algorithm is: |
The table used by the above algorithm is: |
| 1661 |
#ja |
#ja |
|
先述の算法で用いる表は、次の通りです。 |
|
| 1662 |
|
先述の算法で用いる表は、次の通りです。 |
| 1663 |
|
|
| 1664 |
|
#en |
| 1665 |
|
Sniffed type |
| 1666 |
|
#ja |
| 1667 |
|
探知型 |
| 1668 |
|
|
| 1669 |
|
#en |
| 1670 |
|
Security |
| 1671 |
|
#ja |
| 1672 |
|
保安性 |
| 1673 |
|
|
| 1674 |
|
#en |
| 1675 |
|
Comment |
| 1676 |
|
#ja |
| 1677 |
|
注釈 |
| 1678 |
|
|
| 1679 |
|
#en |
| 1680 |
|
Mask |
| 1681 |
|
#ja |
| 1682 |
|
マスク |
| 1683 |
|
|
| 1684 |
|
#en |
| 1685 |
|
Pattern |
| 1686 |
|
#ja |
| 1687 |
|
パターン |
| 1688 |
|
|
| 1689 |
|
#en |
| 1690 |
|
Scriptable |
| 1691 |
|
#ja |
| 1692 |
|
スクリプト可能 |
| 1693 |
|
|
| 1694 |
|
#en |
| 1695 |
|
The string "<code title=""><!DOCTYPE HTML</code>" in US-ASCII or compatible encodings, case-insensitively. |
| 1696 |
|
#ja |
| 1697 |
|
US-ASCII や互換な符号化で文字列「<code title=""><!DOCTYPE HTML</code>」 |
| 1698 |
|
を大文字または小文字で。 |
| 1699 |
|
|
| 1700 |
|
#en |
| 1701 |
|
The string "<code title=""><HTML</code>" in US-ASCII or compatible encodings, case-insensitively, possibly with leading spaces. |
| 1702 |
|
#ja |
| 1703 |
|
US-ASCII や互換な符号化で文字列「<code title=""><HTML</code>」 |
| 1704 |
|
を大文字または小文字で、最初に間隔があってもよい。 |
| 1705 |
|
|
| 1706 |
|
#en |
| 1707 |
|
The string "<code title=""><HEAD</code>" in US-ASCII or compatible encodings, case-insensitively, possibly with leading spaces. |
| 1708 |
|
#ja |
| 1709 |
|
US-ASCII や互換な符号化で文字列「<code title=""><HEAD</code>」 |
| 1710 |
|
を大文字または小文字で、最初に間隔があってもよい。 |
| 1711 |
|
|
| 1712 |
|
#en |
| 1713 |
|
The string "<code title=""><SCRIPT</code>" in US-ASCII or compatible encodings, case-insensitively, possibly with leading spaces. |
| 1714 |
|
#ja |
| 1715 |
|
US-ASCII や互換な符号化で文字列「<code title=""><SCRIPT</code>」 |
| 1716 |
|
を大文字または小文字で、最初に間隔があってもよい。 |
| 1717 |
|
|
| 1718 |
|
#en |
| 1719 |
|
The string "<code title="">%PDF-</code>", the PDF signature. |
| 1720 |
|
#ja |
| 1721 |
|
文字列「<code title="">%PDF-</code>」、 PDF 署名。 |
| 1722 |
|
|
| 1723 |
|
#en |
| 1724 |
|
Safe |
| 1725 |
|
#ja |
| 1726 |
|
安全 |
| 1727 |
|
|
| 1728 |
|
#en |
| 1729 |
|
The string "<code title="">%!PS-Adobe-</code>", the PostScript signature. |
| 1730 |
|
<!-- copied from the text or binary section above --> |
| 1731 |
|
#ja |
| 1732 |
|
文字列「<code title="">%!PS-Adobe-</code>」、PostScript 署名。 |
| 1733 |
|
<code title="">%!PS-Adobe-</code> |
| 1734 |
|
|
| 1735 |
|
#en |
| 1736 |
|
n/a |
| 1737 |
|
#ja |
| 1738 |
|
N/A |
| 1739 |
|
|
| 1740 |
|
#en |
| 1741 |
|
The string "<code title="">GIF87a</code>", a GIF signature. |
| 1742 |
|
#ja |
| 1743 |
|
文字列「<code title="">GIF87a</code>」、GIF 署名。 |
| 1744 |
|
|
| 1745 |
|
#en |
| 1746 |
|
The string "<code title="">GIF89a</code>", a GIF signature. |
| 1747 |
|
#ja |
| 1748 |
|
文字列「<code title="">GIF89a</code>」、GIF 署名。 |
| 1749 |
|
|
| 1750 |
|
#en |
| 1751 |
|
The PNG signature. |
| 1752 |
|
#ja |
| 1753 |
|
PNG 署名。 |
| 1754 |
|
|
| 1755 |
|
#en |
| 1756 |
|
A JPEG SOI marker followed by the first byte of another marker. |
| 1757 |
|
#ja |
| 1758 |
|
JPEG SOI マーカーの後に別のマーカーの最初のバイト。 |
| 1759 |
|
|
| 1760 |
|
#en |
| 1761 |
|
The string "<code title="">BM</code>", a BMP signature. |
| 1762 |
|
#ja |
| 1763 |
|
文字列「<code title="">BM</code>」、BMP 署名。 |
| 1764 |
|
|
| 1765 |
|
#en |
| 1766 |
|
A 0 word following by a 1 word, a Windows Icon file format signature. |
| 1767 |
|
#ja |
| 1768 |
|
語 0 の後に語 1、 Windows アイコン・ファイル書式署名。 |
| 1769 |
|
|
| 1770 |
|
#en |
| 1771 |
|
I'd like to add types like MPEG, AVI, Flash, |
| 1772 |
|
Java, etc, to the above table. |
| 1773 |
|
#ja |
| 1774 |
|
MPEG、AVI、Flash、Java などの型も上の表に追加したいと思っています。 |
| 1775 |
|
|
| 1776 |
|
#en |
| 1777 |
|
User agents may support further types if desired, by implicitly |
| 1778 |
|
adding to the above table. However, user agents should not use any |
| 1779 |
|
other patterns for types already mentioned in the table above, as |
| 1780 |
|
this could then be used for privilege escalation (where, e.g., a |
| 1781 |
|
server uses the above table to determine that content is not HTML |
| 1782 |
|
and thus safe from XSS attacks, but then a user agent detects it as |
| 1783 |
|
HTML anyway and allows script to execute). |
| 1784 |
|
#ja |
| 1785 |
|
利用者エージェントは、必要があれば、前掲の表に暗示的に追加することによって、 |
| 1786 |
|
更に別の型に対応して[[MAY:構いません]]。 |
| 1787 |
|
しかし、前掲の表で既に言及されている型に関して他のパターンを使うと、 |
| 1788 |
|
特権昇格に使うことができてしまいます |
| 1789 |
|
(例えば、鯖が前掲の表を使って内容が HTML ではないと判定し、 |
| 1790 |
|
よって XSS 攻撃に関して安全と判定したところ、 |
| 1791 |
|
利用者エージェントがそれは HTML であると判定し、 |
| 1792 |
|
スクリプトが実行されるのを認めてしまいます。) から、 |
| 1793 |
|
利用者エージェントはそうする[[SHOULD NOT:べきではありません]]。 |
| 1794 |
|
|
| 1795 |
|
|
| 1796 |
|
#en |
| 1797 |
|
The column marked "security" is used by the algorithm in the |
| 1798 |
|
"text or binary" section, to avoid sniffing <code title="">text/plain</code> content as a type that can be used for a |
| 1799 |
|
privilege escalation attack. |
| 1800 |
|
#ja |
| 1801 |
|
「保安性」と印された列は、「テキストまたはバイナリー」の節の算法で、 |
| 1802 |
|
<code title="">text/plain</code> |
| 1803 |
|
の内容を特権昇格攻撃に使える型と探知してしまうことを避けるために使います。 |
| 1804 |
|
|
| 1805 |
|
|
| 1806 |
|
#pattern |
| 1807 |
|
<span class=secno>* </span><dfn>Content-Type sniffing: image</dfn> |
| 1808 |
|
#ja |
| 1809 |
|
<span class=secno>$1 </span><dfn>Content-Type 探知: 画像</dfn> |
| 1810 |
|
|
| 1811 |
|
#en |
| 1812 |
|
If the resource's <var title="">official type</var> is |
| 1813 |
|
"image/svg+xml", then the sniffed type of the resource is its <var title="">official type</var> (an XML type). |
| 1814 |
|
#ja |
| 1815 |
|
資源の <var title="">official type</var> が |
| 1816 |
|
「image/svg+xml」の場合、資源の探知型はその |
| 1817 |
|
<var title="">official type</var> (XML 型) です。 |
| 1818 |
|
|
| 1819 |
|
#en |
| 1820 |
|
Otherwise, if the first bytes of the resource match one of the |
| 1821 |
|
byte sequences in the first column of the following table, then the |
| 1822 |
|
sniffed type of the resource is the type given in the corresponding |
| 1823 |
|
cell in the second column on the same row: |
| 1824 |
|
#ja |
| 1825 |
|
そうでない場合、資源の最初の数バイトが次の表の最初の列のバイト列のいずれかと一致する場合、 |
| 1826 |
|
資源の探知型は同じ行の2番目の列の対応するこまで与えられる型です。 |
| 1827 |
|
|
| 1828 |
|
#en |
| 1829 |
|
Comment |
| 1830 |
|
<!-- update the table above if you change this! --> |
| 1831 |
|
#ja |
| 1832 |
|
注釈 |
| 1833 |
|
<!-- update the table above if you change this! --> |
| 1834 |
|
|
| 1835 |
|
#en |
| 1836 |
|
A 0 word following by a 1 word, a Windows Icon file format signature. |
| 1837 |
|
<!-- XXX Mozilla also detects ART (AOL proprietary format) and Windows Cursor files --> |
| 1838 |
|
#ja |
| 1839 |
|
語 0 の後に語 1、 Windows アイコン・ファイル書式署名。 |
| 1840 |
|
<!-- XXX Mozilla also detects ART (AOL proprietary format) and Windows Cursor files --> |
| 1841 |
|
|
| 1842 |
|
#en |
| 1843 |
|
Otherwise, the sniffed type of the resource is the same as |
| 1844 |
|
its <var title="">official type</var>. |
| 1845 |
|
#ja |
| 1846 |
|
そうでない場合、資源の探知型は <var title="">official type</var> と同じです。 |
| 1847 |
|
|
| 1848 |
|
#pattern |
| 1849 |
|
<span class=secno>* </span><dfn>Content-Type sniffing: feed or HTML</dfn> |
| 1850 |
|
#ja |
| 1851 |
|
<span class=secno>$1 </span><dfn>Content-Type sniffing: フィードまたは HTML</dfn> |
| 1852 |
|
|
| 1853 |
|
#en |
| 1854 |
|
Let <var title="">s</var> be the stream of bytes, and let |
| 1855 |
|
<span><var title="">s</var>[<var title="">i</var>]</span> represent |
| 1856 |
|
the byte in <var title="">s</var> with position <var title="">i</var>, treating <var title="">s</var> as zero-indexed |
| 1857 |
|
(so the first byte is at <span><var title="">i</var>=0</span>). |
| 1858 |
|
#ja |
| 1859 |
|
<var title="">s</var> をバイトのストリームとし、 |
| 1860 |
|
<span><var title="">s</var>[<var title="">i</var>]</span> を <var title="">s</var> |
| 1861 |
|
中の位置 <var title="">i</var> のバイトを表すとします。 |
| 1862 |
|
ただし、 <var title="">s</var> は零索引付けされている |
| 1863 |
|
(ので最初のバイトは位置 <span><var title="">i</var>=0</span> にある) とします。 |
| 1864 |
|
|
| 1865 |
|
#en |
| 1866 |
|
If at any point this algorithm requires the user agent to |
| 1867 |
|
determine the value of a byte in <var title="">s</var> which is not |
| 1868 |
|
yet available, or which is past the first 512 bytes of the |
| 1869 |
|
resource, or which is beyond the end of the resource, the user |
| 1870 |
|
agent must stop this algorithm, and assume that the sniffed type of |
| 1871 |
|
the resource is "text/html". |
| 1872 |
|
#ja |
| 1873 |
|
この算法のいずれかの地点で利用者エージェントが <var title="">s</var> 中のまだ利用可能となっていないバイトや資源の最初の512バイトを越えたバイトや資源の終わりを越えたバイトの値を判断することを要求する場合には、 |
| 1874 |
|
利用者エージェントはこの算法を停止し、資源の探知型は「text/html」 |
| 1875 |
|
であるとしなければ[[MUST:なりません]]。 |
| 1876 |
|
|
| 1877 |
|
|
| 1878 |
|
#en |
| 1879 |
|
User agents are allowed, by the first step of this |
| 1880 |
|
algorithm, to wait until the first 512 bytes of the resource are |
| 1881 |
|
available. |
| 1882 |
|
#ja |
| 1883 |
|
利用者エージェントは、この算法の最初の段階により、資源の最初の 512 バイトが利用可能となるまで待つことが認められています。 |
| 1884 |
|
|
| 1885 |
|
#en |
| 1886 |
|
Initialize <var title="">pos</var> to 0. |
| 1887 |
|
#ja |
| 1888 |
|
<var title="">pos</var> を 0 に初期化します。 |
| 1889 |
|
|
| 1890 |
|
#en |
| 1891 |
|
If <span><var title="">s</var>[0]</span> is 0xEF, <span><var title="">s</var>[1]</span> is 0xBB, and <span><var title="">s</var>[2]</span> is 0xBF, then set <var title="">pos</var> to 3. (This skips over a leading UTF-8 BOM, if |
| 1892 |
|
any.) |
| 1893 |
|
#ja |
| 1894 |
|
<span><var title="">s</var>[0]</span> が 0xEF、 |
| 1895 |
|
<span><var title="">s</var>[1]</span> が 0xBB、 |
| 1896 |
|
<span><var title="">s</var>[2]</span> が 0xBF |
| 1897 |
|
の場合、 <var title="">pos</var> を 3 に設定します。 |
| 1898 |
|
(これは先頭に UTF-8 BOM があれば読み飛ばします。) |
| 1899 |
|
|
| 1900 |
|
|
| 1901 |
|
#en |
| 1902 |
|
<i>Loop start:</i> Examine <span><var title="">s</var>[<var title="">pos</var>]</span>. |
| 1903 |
|
#ja |
| 1904 |
|
<i>ループ開始:</i> <span><var title="">s</var>[<var title="">pos</var>]</span> を調べます。 |
| 1905 |
|
|
| 1906 |
|
#en |
| 1907 |
|
If it is 0x09 (ASCII tab), 0x20 (ASCII space), 0x0A (ASCII LF), or 0x0D (ASCII CR) |
| 1908 |
|
#ja |
| 1909 |
|
0x09 (ASCII タブ)、0x20 (ASCII 間隔)、0x0A (ASCII LF)、0x0D (ASCII CR) |
| 1910 |
|
のいずれかの場合 |
| 1911 |
|
|
| 1912 |
|
#en |
| 1913 |
|
Increase <var title="">pos</var> by 1 and repeat this step. |
| 1914 |
|
#ja |
| 1915 |
|
<var title="">pos</var> を 1 増加させ、この段階を繰り返します。 |
| 1916 |
|
|
| 1917 |
|
#en |
| 1918 |
|
If it is 0x3C (ASCII "<code title=""><</code>") |
| 1919 |
|
#ja |
| 1920 |
|
0x3C (ASCII "<code title=""><</code>") の場合 |
| 1921 |
|
|
| 1922 |
|
#en |
| 1923 |
|
Increase <var title="">pos</var> by 1 and go to the next step. |
| 1924 |
|
#ja |
| 1925 |
|
<var title="">pos</var> を 1 増加させ、次の段階へ行きます。 |
| 1926 |
|
|
| 1927 |
|
#en |
| 1928 |
|
If it is anything else |
| 1929 |
|
#ja |
| 1930 |
|
それ以外の場合 |
| 1931 |
|
|
| 1932 |
|
#en |
| 1933 |
|
The sniffed type of the resource is "text/html". Abort these |
| 1934 |
|
steps. |
| 1935 |
|
#ja |
| 1936 |
|
資源の探知型は「text/html」です。これらの段階を停止します。 |
| 1937 |
|
|
| 1938 |
|
#en |
| 1939 |
|
If the bytes with positions <var title="">pos</var> to |
| 1940 |
|
<span><var title="">pos</var>+2</span> in <var title="">s</var> are |
| 1941 |
|
exactly equal to 0x21, 0x2D, 0x2D respectively (ASCII for "<code title="">!--</code>"), then: |
| 1942 |
|
#ja |
| 1943 |
|
<var title="">s</var> 中の位置 <var title="">pos</var> ~ <span><var title="">pos</var>+2</span> |
| 1944 |
|
のバイトが 0x21、0x2D、0x2D |
| 1945 |
|
(ASCII の「<code title="">!--</code>」) とそれぞれ正確に等しい場合、 |
| 1946 |
|
|
| 1947 |
|
#en |
| 1948 |
|
Increase <var title="">pos</var> by 3. |
| 1949 |
|
#ja |
| 1950 |
|
<var title="">pos</var> を 3 増加させます。 |
| 1951 |
|
|
| 1952 |
|
#en |
| 1953 |
|
If the bytes with positions <span><var title="">pos</var></span> to <span><var title="">pos</var>+2</span> in <var title="">s</var> are exactly |
| 1954 |
|
equal to 0x2D, 0x2D, 0x3E respectively (ASCII for "<code title="">--></code>"), then increase <var title="">pos</var> |
| 1955 |
|
by 3 and jump back to the previous step (the step labeled |
| 1956 |
|
<i>loop start</i>) in the overall algorithm in this section. |
| 1957 |
|
#ja |
| 1958 |
|
<var title="">s</var> 中の位置 <span><var title="">pos</var></span> ~ <span><var title="">pos</var>+2</span> のバイトがそれぞれ 0x2D、0x2D、0x3E (ASCII の |
| 1959 |
|
「<code title="">--></code>」) と正確に等しい場合、 |
| 1960 |
|
<var title="">pos</var> を 3 増加させ、この節の全体の算法の前の段階 |
| 1961 |
|
(<i>ループ開始</i>と名札付けされた段階) に飛んで戻ります。 |