view Side-By-Side changes
Network Working Group B. Hoehrmann Internet-DraftSeptember 21, 2001February 5, 2005 Expires:March 22, 2002 JavaScript and ECMAScriptAugust 9, 2005 Scripting Media Types<draft-hoehrmann-script-types-00.txt>draft-hoehrmann-script-types-01 Status of this Memo This document is an Internet-Draft and isin full conformance withsubject to all provisions of Section103 of RFC 3667. By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any ofRFC2026.which he or she become aware will be disclosed, in accordance with RFC 3668. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents asInternet- Drafts.Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire onMarch 22, 2002.August 9, 2005. Copyright Notice Copyright (C) The Internet Society(2001). All Rights Reserved.(2005). AbstractJavaScript and ECMAScript are Scripting Languages commonly used on the World Wide Web for years, using various unregistered Media Types.This memoseeks to regularize that position by formally registering Media Typesdescribes media types forthese Scripting Languages.the ECMAScript and JavaScript programming languages. Hoehrmann ExpiresMarch 22, 2002August 9, 2005 [Page 1] Internet-DraftJavaScript and ECMAScriptScripting Media TypesSeptember 2001February 2005 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1History and StandardizationBackground . . . . . . . . . . . . . . . . .3 1.2 Implementations and Usage. . . . . . 3 1.2 Deployed Scripting Media Types . . . . . . . . . . . . . 3 1.3RationaleCompatibility . . . . . . . . . . . . . . . . . . . . .. . . . . 34 2. Conformance and Document Conventionsused in this document .. . . . . . . . . . . . .45 3.The text/javascript Media Type . .Character Encoding Scheme Handling . . . . . . . . . . . . . .45 3.1Notes on text/javascriptCharset Parameter . . . . . . . . . . . . . . . . . . .46 3.2Registration of text/javascript . . . . . . . . . . . . . . . 4 4. The application/javascript Media Type . .Character Encoding Scheme Detection . . . . . . . . . .5 4.1 Notes on application/javascript6 3.3 Character Encoding Scheme Error Handling . . . . . . . . 7 4. Security Considerations . . . . . . .5 4.2 Registration of application/javascript. . . . . . . . . . . .68 5.The text/ecmascript Media Type . . . . . . . . . . . . . . . . 7 5.1 Notes on text/ecmascript .IANA Considerations . . . . . . . . . . . . . . . . . .7 5.2 Registration of text/ecmascript. . . 10 6. JavaScript Media Types . . . . . . . . . . . .7 6. Registration Details. . . . . . . . 10 6.1 text/javascript . . . . . . . . . . . . .8 6.1 The charset parameter. . . . . . . 10 6.2 application/javascript . . . . . . . . . . . . .8 6.2 The version parameter. . . . 11 7. ECMAScript Media Types . . . . . . . . . . . . . . . .8 6.3 Encoding Considerations. . . . 12 7.1 text/ecmascript . . . . . . . . . . . . . . .8 6.4 Security Considerations. . . . . 12 7.2 application/ecmascript . . . . . . . . . . . . . .8 6.5 Interoperability Considerations. . . 13 8. References . . . . . . . . . . . .10 6.6 Published JavaScript specifications. . . . . . . . . . . . .10 6.7 Published ECMAScript Specifications. 14 8.1 Normative References . . . . . . . . . . . .10 6.8 Accessibility Considerations. . . . . . 14 8.2 Informative References . . . . . . . . . . .10 7. Notes on Microsoft's JScript language. . . . . . 14 Author's Address . . . . . .10 8. Acknowledgments. . . . . . . . . . . . . . . . . 15 Intellectual Property and Copyright Statements . . . . . .11 References. .. . . . . . . . . . . . . . . . . . . . . . . . 11 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 12 Full Copyright Statement . . . . . . . . . . . . . . . . . . . 1316 Hoehrmann ExpiresMarch 22, 2002August 9, 2005 [Page 2] Internet-DraftJavaScript and ECMAScriptScripting Media TypesSeptember 2001February 2005 1. Introduction 1.1History and Standardization JavaScript is a cross-platform, object-based scripting language originally developed by Netscape Communications Corp. It is beeing used since 1995 on web pages onBackground This memo describes media types for theWorld Wide Web and in various other environments. In 1997JavaScriptwas formally standardized by TC 39 of the European Computer Manufacturers Association (ECMA) as ECMA-262 [ECMA-262] ("ECMAScript")andadopted by the International Standardization Organization (ISO) as ISO/IEC 16262:1998 [ISO16262] in April 1998. NOTE: JavaScript is a trademark of Sun Microsystems, Inc. It was originally called LiveScript. It has nothingECMAScript programming languages. Refer todo with the Java Language. 1.2 Implementations"Brief History" andUsage Several web browsers support the ability to download programs with an HTML document"Overview" in [ECMA] for background information on these languages. Programs written in these programming languages have historically been interchanged using inapplicable, experimental, andexecute them withinunregistered media types. This document defines four of thebrowser. These programs are typicallymost commonly used media types for such programs tointeract with the browser user and adding dynamic features to otherwise static content. The first implementation of JavaScript wasreflect this usage in theweb browser Netscape Navigator 2.0 developedIANA media type registry, foster interoperability byNetscape Communications Corporation. But ECMAScriptdefining underspecified aspects, andJavaScript are by no means limited to browsers or client-side applications in general. For example, SVG 1.0 [SVG10] (an XML-based vector graphics format) requires Dynamic SVG Viewerstosupport ECMAScriptprovide general security considerations. 1.2 Deployed Scripting Media Types Media types used toallow animation of and interaction withexchange programs written in thegraphic, andbeforementioned programming languages or similar variants thereof include: +-----------------------------------------------------+ | text/javascript | text/ecmascript | | text/javascript1.0 | text/javascript1.1 | | text/javascript1.2 | text/javascript1.3 | | text/javascript1.4 | text/javascript1.5 | | text/jscript | text/livescript | | text/x-javascript | text/x-ecmascript | | application/x-javascript | application/x-ecmascript | | application/javascript | application/ecmascript | +-----------------------------------------------------+ Of these types, this document defines theNetscape Enterprise Server provides a means tofollowing: * text/javascript * text/ecmascript * application/javascript * application/ecmascript Use of their experimental counterparts is discouraged per [RFC2048], section 2.1.4. Use of other types for scripts that could useJavaScript on the server-side. Available Open Source implementations like SpiderMonkey (<http://www.mozilla.org/js/spidermonkey/>) and Rhino (<http://www.mozilla.org/rhino/>) ease the usageone ofthese scripting languagesthe types defined inother domains. 1.3 Rationale Many common Internetthis document as well is discouraged. The media types text/javascript andWorld Wide Web protocols require the useapplication/javascript are not considered distinct in this document. Use ofproperly registered Media Types to identifyadditional names for the same media typeof local or remote resources. Unfortunately no Media Types for JavaScriptis discouraged andECMAScript were officially registered. As a result of this omission, private Media Types like application/x-javascript are used to identify these scripting languages. This memo seeks to regularize that position by formally registering Media Types for these Scripting Languages. While it may be ok for some people to use these private and/or unregistered Media Types,itisn't for others. Some organizations have strict policies towards standards,is thusthey may be unable to useexpected that an update of this document deprecates one of theseScripting Languages at all.types. Hoehrmann ExpiresMarch 22, 2002August 9, 2005 [Page 3] Internet-DraftJavaScript and ECMAScriptScripting Media TypesSeptember 2001February 2005 Thismemo does not introduce new Media Types, it just registers the Media Types useddocument considers text/ecmascript and application/ecmascript distinct in terms of processing rules; use of and support forseveral years now. Itthe media type application/ecmascript isnot acceptable to break with common practice on millionconsiderably less widespread than ofweb sites, thus there has been no chance to choose Media Typestext/ecmascript; this document takes thatwould potentially be more appropriate. NOTE: The author ofto its advantage and defines stricter processing rules for thismemotype to foster more interoperable processing. It isnot affiliated with anyexpected that an update ofthe companies and organizations mentioned in this document. 2. Conventions used inthis document will deprecate the media type text/ecmascript. 1.3 Compatibility Thekey words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL"types defined in this document are applicable tobe interpreted as describedscripts written in[RFC2119] . 3. The text/javascript Media Type 3.1 Notes on text/javascript The Media Type text/javascript is being used for internal[JS15] and [ECMA] respectively as well as to scripts written inHTML documentsa compatible language andsome external scripts. It should be usedcorresponding profiles such as [EcmaCompact]. This document does not address scripts written infavorother languages, in particular, future versions of JavaScript, future editions of [ECMA], and extensions toapplication/javascript where appropriate. ECMAScript scripts[ECMA] such as [E4X] are not directly addressed. This document may belabeled with this Media Type if they are conformingupdated toa given version of JavaScript. 3.2 Registration of text/javascript MIME media type name: text MIME subtype name: javascript Required parameters: none Optional parameters: charset See Section 6.1extend the definition of the types in thisdocument. version See Section 6.2document to take other content into account. Updates of thisdocument. Encoding considerations: See Section 6.3document may introduce new optional parameters, implementations MUST consider the impact of such an update. For the application/ecmascript media type thisdocument. Security considerations: See Section 6.4document reserves the parameter "version" to allow updates of thisdocument. Hoehrmann Expires March 22, 2002 [Page 4] Internet-Draft JavaScript and ECMAScript Media Types September 2001 Interoperability considerations: See Section 6.5document to extend the media type for content that is not compatible to implementations ofthis document. Published specification: See Section 6.6[ECMA]. Implementations ofthis document. Applications which use thisthe application/ecmascript mediatype: See Section 1.2type MUST NOT process content labeled with a version parameter as if no version parameter had been specified. This requirement is generally satisfied by treating such content as unsupported. Processing of unsupported content is out of scope of this document.Additional information: Magic number(s): none File extension(s): js Macintosh File Type Code(s): TEXT Person & email address to contactThis document does not define similar means forfurther information: Bjoern Hoehrmann <bjoern@hoehrmann.de> Intended usage: COMMON Author/Change controller: JavaScript isany other type as deployed software typically ignores unknown parameters which renders such awork productreserved parameter ofNetscape Communications Corporation. Netscape has change control over the JavaScript specification. 4. The application/javascript Media Type 4.1 Notes on application/javascript The private Media Type application/x-javascript has been usedlittle use forexternal scripts linked from HTML documents.those types. Theleading web server software Apache (http://httpd.apache.org/) uses it as defaultprogramming languages defined in [JS15] and [ECMA] share a common subset. Choice of a type forfiles with the file name extension ".js". Some early implementations of JavaScript may require this Media Typescripts compatible torecognize JavaScript, but usage of text/javascriptboth languages ispreferred where compatibilitysubject tothese implementations isn't required, thus the registrationfactors out ofapplication/javascript in this memo lists "LIMITED USE" as intended usage. Applications SHOULD support the "x-"-prefixed Media Type "application/x-javascript" as aliasscope ofapplication/javascript for compatibility reasons. ECMAScript scripts MAY be labeled withthisMedia Type if they are Hoehrmann Expires March 22, 2002 [Page 5] Internet-Draft JavaScriptdocument andECMAScript Media Types September 2001 conforming to a given versionthus not addressed. This document does not define how fragment identifiers in resource identifiers ([RFC3986], [RFC3987]) for documents ofJavaScript. 4.2 Registrationone ofapplication/javascript MIMEthe mediatype name: application MIME subtype name: javascript Required parameters: none Optional parameters: charset See Section 6.1 of this document. version See Section 6.2 of this document. Encoding considerations: See Section 6.3 of this document. Security considerations: See Section 6.4 of this document. Interoperability considerations: See Section 6.5 oftypes defined in thisdocument. Published specification: See Section 6.6document are resolved. An update of thisdocument. Applications which use this media type: See Section 1.2document may define processing ofthis document. Additional information: Magic number(s): none File extension(s): js Macintosh File Type Code(s): TEXT Person & email address to contact for further information: Bjoern Hoehrmann <bjoern@hoehrmann.de> Intended usage: COMMON Author/Change controller:fragment identifiers. Hoehrmann ExpiresMarch 22, 2002August 9, 2005 [Page6]4] Internet-DraftJavaScript and ECMAScriptScripting Media TypesSeptember 2001 JavaScript is a work product of Netscape Communications Corporation. Netscape has change control over the JavaScript specification. 5.February 2005 2. Conformance and Document Conventions Thetext/ecmascript Media Type 5.1 Notes on text/ecmascript By the best of the author's knowledge, this Media Type has been introduced by the SVG [SVG10] specifications. It is beeing used therekey words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", anddefined as the default value for the 'contentScriptType' attribute of the 'svg' element. JavaScript scripts may be labeled with"OPTIONAL" in thisMedia Type if theydocument areconformingto be interpreted as described in BCP 14, [RFC2119] and indicate requirement levels for compliant implementations. Requirements apply to all implementations unless otherwise stated. An implementation is agiven revision of ECMA-262. 5.2 Registrationsoftware module that supports one oftext/ecmascript MIMEthe mediatype name: text MIME subtype name: ecmascript Required parameters: none Optional parameters: charset See Section 6.1 of this document. version See Section 6.2 oftypes defined in this document. Software modules may support multiple media types but are considered multiple implementations. Implementations that fail to satisfy one or more "MUST" requirements are considered non-compliant. Implementations that satisfy all "MUST" requirements but fail to satisfy one or more "SHOULD" requirements are said to be "conditionally compliant". All other implementations are "unconditionally compliant". 3. Character Encodingconsiderations: See Section 6.3 of this document. Security considerations: See Section 6.4Scheme Handling Refer to [RFC3536] for a discussion of terminology in thisdocument. Interoperability considerations: See Section 6.5section. Source text ([ECMA], section 6) can be binary source text. Binary source text is a textual data object that represents source text encoded using a character encoding scheme. A textual data object is a whole text protocol message or a whole text document, or a part ofthis document. Published specification: See Section 6.7it, that is treated separately for purposes ofthis document. Applications which use this media type: Hoehrmann Expires March 22, 2002 [Page 7] Internet-Draft JavaScriptexternal storage andECMAScript Media Types September 2001 See Section 1.2retrieval. An implementation's internal representation ofthis document. Additional information: Magic number(s): none File extension(s): ecma, es Macintosh File Type Code(s): TEXT Person & email addresssource text and source text are not considered binary source text. Implementations need tocontact for further information: Bjoern Hoehrmann <bjoern@hoehrmann.de> Intended usage: COMMON Author/Change controller: ECMAScript isdetermine awork product of Technical Committee 39 of the European Computer Manufacturers Association (ECMA). ECMA has change control over the ECMA-262 specification. 6. Registration Details 6.1 The charset parametercharacter encoding scheme in order to decode binary source text to source text. The media types defined in this document allow an optional charset parameter"charset" refersto explicitly specify the character encoding scheme used torepresentencode theECMAScript respectivelysource text. How implementations determine theJavaScript document as a sequence of bytes. Any registered IANA charset may be used, but UTF-8 is preferred. Although this parameter is optional, it is strongly recommended that it alwayscharacter encoding scheme can bepresent. This memo doesn't define any default value for this parameter. 6.2 The version parameter The optional parameter "version" referssubject tothe versionprocessing rules out ofJavaScript respectively the revisionscope ofECMA-262 the script is written in. This memo doesn't define any default value forthisparameter. 6.3 Encoding Considerations For use with transportsdocument, transport protocols for example can require thatare not 8-Bit clean, quoted-printablea specific character encoding scheme isrecommended since the majority of characters willto beECMAScript respectively JavaScript syntax and thus US-ASCII. 6.4 Security Considerations Programs written in JavaScriptassumed if the optional charset parameter is not specified, orECMAScript, just like programs writtenthey can require that the charset parameter is used inother languages, may contain malicious code. Since thosecertain cases. Such requirements are not considered part of this document. Implementations that support binary source text MUST support binary source text encoded using the UTF-8 [RFC3629] character encoding scheme. Other character encoding schemes MAY be supported. Use of UTF-8 to encode binary source text is encouraged but not required. Hoehrmann ExpiresMarch 22, 2002August 9, 2005 [Page8]5] Internet-DraftJavaScript and ECMAScriptScripting Media TypesSeptember 2001 scripts are normally executed without further notice to the user, care has to be taken by implementors in what those scripts are allowed to do inFebruary 2005 3.1 Charset Parameter The charset parameter provides agiven security context. In Web browsers, they are executed inmeans to specify thesecurity contextcharacter encoding scheme of binary source text. Its value MUST match thepage with which they were downloaded, and they have restricted access to other resources within the browser. Earlymime-charset production defined in [RFC2278], section 3.3. An illegal value is a value that does not match that production. 3.2 Character Encoding Scheme Detection It is possible that implementationsof JavaScript had several security flaws. The book "JavaScript - The Definitive Guide" publishedcannot interoperably determine a single character encoding scheme simply byO'Reilly and Associates [JSGUIDE] says in chapter 1.5 (quotedcomplying withpermission): "In Navigator 2, for example, it was possible to write JavaScript code that could automatically steal the email addressall requirements ofany visitor tothepage containingapplicable specifications. To foster interoperability in such cases, thecode. More worrisome wasfollowing algorithm is defined. Implementations apply this algorithm until a single character encoding scheme is determined. 1. If a charset parameter with a legal value is specified, therelated capability to send email invalue determines thevisitor's name, withoutcharacter encoding scheme. 2. If thevisitor's knowledge or approval. This was done by defining an HTML form,binary source text starts with amailto: URL as its ACTION attribute and using POST as the submission method. With thisUnicode encoding formdefined, JavaScript code could then callsignature, theform object's submit() method whensignature determines thepage containingencoding. The following octet sequences at theform was first loaded. This automatically generated mail invery beginning of thevisitor's name to any desired address.binary source text are considered with their corresponding character encoding schemes: +------------------+----------+ | Leading sequence | Encoding | +------------------+----------+ | 00 00 FF FE | UTF-32LE | | FE FF 00 00 | UTF-32BE | | FF FE | UTF-16LE | | FE FF | UTF-16BE | | EF BB BF | UTF-8 | +------------------+----------+ Themail containedlongest matching octet sequence determines thevisitor's email address, which could be stolen forencoding. Implementations of this step MUST usein Internet marketing, for example. Furthermore, by setting appropriate values withinthese octet sequences to determine the character encoding scheme even if theform,determined scheme is not supported. If thismalicious JavaScript code could send a message instep determines theuser's name to any email address." CERT Advisory CA-1997-20 [CA-1997-20] gives information on further security flaws in those early implementations: "The CERT Coordination Center has received reports of a vulnerability in JavaScript that enables remote attackerscharacter encoding scheme, the octet sequence representing the Unicode encoding form signature MUST be ignored when decoding the binary source text tomonitor a user's Web activities. The vulnerability affects several Web browsers that support JavaScript.source text. 3. Thevulnerability can be exploited even ifcharacter encoding scheme is determined as UTF-8. If thebrowsercharacter encoding scheme isbehind a firewalldetermined as UTF-8 through any means but step 2 as defined above andeven when users browse "secure" HTTPS-based documents." Fortunately, most known security issues within common implementations have been fixed in recent versions. However, these scripting languages are commonly used to manipulate the document object model of given documents, thus they can be used to hide information otherwise visible, for example by removing elements fromthedocument tree. This feature also enables scripts to initiate transfers of arbitrary network resources, e.g. by settingbinary source text starts with the'src' attribute ofoctet sequence EF BB BF, theHTML element 'img' to a new URI. Security considerations on these resources are subject to individualoctet sequence is ignored when Hoehrmann ExpiresMarch 22, 2002August 9, 2005 [Page9]6] Internet-DraftJavaScript and ECMAScriptScripting Media TypesSeptember 2001 registered types. This also enables scriptsFebruary 2005 decoding the binary source text totransfer information on e.g.source text. (The sequence will also be ignored if step 2 determines thebrowser orcharacter encoding scheme per thecomputing environment back torequirements in step 2). Implementations of theserver. Consider a browser providing access to information ontypes text/javascript, text/ecmascript, and application/javascript SHOULD and implementations of thebrowser itself,type application/ecmascript MUST implement theoperating system, screen resolution, installed software, etc. These information could be transferred torequirements defined in this section in theserver by appending a string tocited case. 3.3 Character Encoding Scheme Error Handling The following error processing behavior is RECOMMENDED for thenew URI, e.g. http://host/?os=Win95&browser=IE5. This affects users privacymedia types text/javascript, text/ecmascript, andcould be used to exploit vulnerabilities. 6.5 Interoperability Considerations JavaScript is used on million of web sites todayapplication/javascript, and REQUIRED for thescripts are running on different computer platforms and web browsers at least most ofmedia type application/ecmascript. o If thetime. The standardized siblingvalue ofJavaScript, ECMAScript,a charset parameter ismeant to further improve interoperability and recently deployedillegal, implementationsclaim to be conforming to [ECMA-262] . Additionally,MAY recover from theWorld Wide Web Consortium (http://www.w3.org) standardizederror by ignoring theDocument Object Model (http://www.w3.org/DOM/) used in various web browsers and recently deployed web browsers claim to adhere to some Level ofparameter or MAY consider theDocument Object Model. 6.6 Published JavaScript specifications As of time of publication of this document,character encoding scheme unsupported. o If binary source text is determined to be encoded using a certain character encoding scheme thelatest JavaScript versionimplementation is1.4, as formally specified inunable to process, implementations MUST consider theCore JavaScript Reference [JS14] . 6.7resource unsupported (i.e., they MUST NOT decode the binary source text using a different character encoding scheme.) o Binary source text can be determined to be encoded using a certain character encoding scheme but contain octet sequences that are not legal according to that scheme. This is typically caused by lack of proper character encoding scheme information; such errros can pose a security risk as discussed in section 4. Implementations SHOULD detect such errors as early as possible, in particular, they SHOULD detect them before interpreting any of the source text; implementations MUST detect such errors and MUST NOT interpret any source text after detecting such an error. Such errors MAY be reported, e.g., as syntax errors as defined in [ECMA], section 16. This document does not define facilities that allow to specify the character encoding scheme used to encode binary source text in a conflicting manner; there are only two sources for character encoding scheme information, the charset parameter and the Unicode encoding form signature; if a charset parameter is specified, binary source text is processed as defined for that character encoding scheme. Hoehrmann Expires August 9, 2005 [Page 7] Internet-Draft Scripting Media Types February 2005 4. Security Considerations Refer to [RFC3552] for a discussion of terminology in this section. Examples in this section, discussions of interactions of host environments with scripts and extensions to [ECMA] are to be understood as non-exhaustive and of purely illustrative nature. The programming language defined in [ECMA] is not intended to be computationally self-sufficient, it is rather expected that the computational environment provides facilities to programs to enable specific functionality. Such facilities constitute unknown factors and are thus considered out of scope of this document. Derived programming languages are permitted to include additional functionality that is not described in [ECMA], such functionality constitutes an unknown factor and is thus considered out of scope of this document. In particular, extensions to [ECMA] defined for the JavaScript programming language are not discussed in this document. Uncontrolled execution of scripts can be exceedingly dangerous. Implementations that execute scripts MUST give consideration to their application's threat models and those of the individual features they implement; in particular, they MUST ensure that untrusted content is not executed in an unprotected environment. Specifications for host environment facilities and for derived programming languages should include security considerations. If an implementation supports such facilities, the respective security considerations apply. In particular, if scripts can be referenced from or included in specific document formats, the considerations for the embedding or referencing document format apply. Scripts embedded in application/xhtml+xml [RFC3236] documents for example could be enabled through the host environment to manipulate the document instance, which could cause the retrieval of remote resources; security considerations regarding retrieval of remote resources of the embedding document would apply in this case. This circumstance can further be used to make information, that is normally only available to the script, available to a web server by encoding the information in the resource identifier of the resource, which can further enable eavesdropping attacks. Implementation of such facilities is subject to the security considerations of the host environment as discussed above. The facilities defined in [ECMA] do not include provisions for input of external data, output of computed results, or modification of aspects of the host environment. An implementation of only the Hoehrmann Expires August 9, 2005 [Page 8] Internet-Draft Scripting Media Types February 2005 facilities defined in [ECMA] is not considered to support dangerous operations. The programming language defined in [ECMA] does include facilities to loop, cause computationally complex operations, or consume large amounts of memory; this includes, but is not limited to, facilities that allow dynamically generated source text to be executed (e.g., the eval() function); uncontrolled execution of such features can cause denial of service which implementations MUST protect against. A host environment can provide facilities to access external input, scripts that pass such input to the eval() function can be vulnerable to code injection attacks; scripts must protect against such attacks. A host environment can provide facilities to output computed results in a user-visible manner, for example, host environments supporting a graphical user interface can provide facilities that enable scripts to present certain messages to the user; implementations MUST take steps to avoid confusion of the origin of such messages; in general, the security considerations for the host environment apply in such a case as discussed above. Implementations are required to support the UTF-8 character encoding scheme; the security considerations of [RFC3629] apply. Additional character encoding schemes may be supported; support for such schemes is subject to the security considerations of those schemes. Source text is expected to be in Unicode Normalization Form C; scripts and implementations MUST consider security implications of unnormalized source text and data; for a detailed discussion of such implications see the security considerations in [RFC3629]. Scripts can be executed in an environment that is vulnerable to code injection attacks; for example, a CGI script [RFC3875] echoing user input could allow the inclusion of untrusted scripts which could be executed in an otherwise trusted environment; this threat scenario is subject to security considerations out of scope of this document. The "data" resource identifier scheme [RFC2397] in combination with the types defined in this document could be used to cause execution of untrusted scripts through the inclusion of untrusted resource identifiers. The security considerations of [RFC2397] apply. Implementations can fail to implement a specific security model or other means to prevent possibly dangerous operations; such failure could possibly be exploited to gain unauthorized access to a system or sensitive information; such failure constitutes an unknown factor and is thus considered out of scope of this document. Hoehrmann Expires August 9, 2005 [Page 9] Internet-Draft Scripting Media Types February 2005 5. IANA Considerations This document registers four new media types as defined in the following sections. 6. JavaScript Media Types 6.1 text/javascript Type name: text Subtype name: javascript Required parameters: none Optional parameters: charset, see section 3.1. Encoding considerations: The same as the considerations in section 3.1 of [RFC3023]. Security considerations: See section 4. Interoperability considerations: None except as noted in other sections of this document. Published specification: [JS15] Applications which use this media type: Script interpreters as discussed in this document. Additional information: Magic number(s): n/a File extension(s): .js Macintosh File Type Code(s): TEXT Person & email address to contact for further information: See Author's Address section. Intended usage: COMMON Restrictions on usage: n/a Author: See Author's Address section. Change controller: The IETF. Hoehrmann Expires August 9, 2005 [Page 10] Internet-Draft Scripting Media Types February 2005 6.2 application/javascript Type name: application Subtype name: javascript Required parameters: none Optional parameters: charset, see section 3.1. Encoding considerations: The same as the considerations in section 3.2 of [RFC3023]. Security considerations: See section 4. Interoperability considerations: None except as noted in other sections of this document. Published specification: [JS15] Applications which use this media type: Script interpreters as discussed in this document. Additional information: Magic number(s): n/a File extension(s): .js Macintosh File Type Code(s): TEXT Person & email address to contact for further information: See Author's Address section. Intended usage: COMMON Restrictions on usage: n/a Author: See Author's Address section. Change controller: The IETF. Hoehrmann Expires August 9, 2005 [Page 11] Internet-Draft Scripting Media Types February 2005 7. ECMAScriptSpecificationsMedia Types 7.1 text/ecmascript Type name: text Subtype name: ecmascript Required parameters: none Optional parameters: charset, see section 3.1. Encoding considerations: The same as the considerations in section 3.1 of [RFC3023]. Security considerations: See section 4. Interoperability considerations: None except as noted in other sections of this document. Published specification: [ECMA] Applications which use this media type: Script interpreters as discussed in this document. Additional information: Magic number(s): n/a File extension(s): .es Macintosh File Type Code(s): TEXT Person & email address to contact for further information: See Author's Address section. Intended usage: COMMON Restrictions on usage: n/a Author: See Author's Address section. Change controller: Thelatest specification for ECMAScriptIETF. Hoehrmann Expires August 9, 2005 [Page 12] Internet-Draft Scripting Media Types February 2005 7.2 application/ecmascript Type name: application Subtype name: ecmascript Required parameters: none Optional parameters: charset, see section 3.1. An additional "version" parameter isECMA-262, revision 3 [ECMA-262] published by the European Computer Manufacturers Associationreserved inDecember 1999.section 1.3; implementations MUST support this parameter even though this document does not define legal use for it. Encoding considerations: Theformer revision 2 has been adopted by ISOsame asISO/IEC 16262:1998 [ISO16262] in April 1998. 6.8 Accessibility Considerations Authors using scripts in combination with (X)HTML documents are encouraged to followthecheckpoints and using the techniques summarizedconsiderations inthe W3C Note "HTML Techniques for Web Content Accessibility Guidelines 1.0" [WCAGTECHS]section12 to insure proper accessibility3.2 oftheir web pages. 7. Notes on Microsoft's JScript language This memo does not attempt to register a Media Type for Microsoft's ECMA-262 implementation called "JScript". JScript is not commonly identified by any MIME type, Microsoft rather uses a "language" attribute[RFC3023]. Security considerations: See section 4. Interoperability considerations: None except as noted inhost documents like the language attributeother sections ofthethis document. Published specification: [ECMA] Applications which use this media type: Script interpreters as discussed in this document. Additional information: Magic number(s): n/a File extension(s): .es Macintosh File Type Code(s): TEXT Person & email address to contact for further information: See Author's Address section. Intended usage: COMMON Restrictions on usage: n/a Author: See Author's Address section. Change controller: The IETF. Hoehrmann ExpiresMarch 22, 2002August 9, 2005 [Page10]13] Internet-DraftJavaScript and ECMAScriptScripting Media TypesSeptember 2001 "script" element in HTML. Microsoft claims that JScript is with only a few minor exceptions a full implementation of the ECMA-262 standard, thus scripts that don't rely on these exceptions MAY be labeled with text/ecmascript. JScript scripts conforming to a given level of JavaScript MAY be labeled as text/javascript or application/javascript. For more information on Microsoft JScript, refer to <http://msdn.microsoft.com/scripting/>.February 2005 8.Acknowledgments Thanks to Marshall T. Rose for providing RFC 2629 and the xml2rfc tool used to generate this memo.References[CA-1997-20] CERT Coordination Center, "CERT Advisory CA-1997-20 - "JavaScript Vulnerability"", July 1997, <http://www.cert.org/advisories/CA-1997-20.html>. [ECMA-262]8.1 Normative References [ECMA] European Computer Manufacturers Association, "ECMAScript Language Specification 3rd Edition", December 1999,<http://www.ecma.ch/ecma1/stand/ecma- 262.htm>. [ISO16262] International Organization for Standardization, "ECMAScript language specification", April 1998, <http://www.iso.ch/cate/d29696.html>. [JS14] Netscape Communications Corporation, "JavaScript 1.4 Core Reference Manual", October 1998, <http://developer.netscape.com/docs/manuals/js/core/ jsref14/contents.htm>. [JSGUIDE] Flanagan, D., "JavaScript: The Definitive Guide, 3rd Edition", ISBN 1-56592-392-8, Published by O'Reilly & Associates, June 1998, <http://www.oreilly.com/catalog/jscript3/>.<http://www.ecma.ch/ecma1/stand/ecma-262.htm>. [RFC2048] Freed, N., Klensin, J. and J. Postel, "Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures", BCP 13, RFC 2048, November 1996. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March1997, <http://www.ietf.org/rfc/rfc2119.txt>. [SVG10] Ferraiolo, J., "Scalable Vector Graphics (SVG) 1.0 Specification", September1997. [RFC2278] Freed, N. and J. Postel, "IANA Charset Registration Procedures", BCP 19, RFC 2278, January 1998. [RFC3023] Murata, M., St. Laurent, S. and D. Kohn, "XML Media Types", RFC 3023, January 2001. [RFC3536] Hoffman, P., "Terminology Used in Internationalization in the IETF", RFC 3536, May 2003. [RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC Text on Security Considerations", BCP 72, RFC 3552, July 2003. [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD 63, RFC 3629, November 2003. 8.2 Informative References [E4X] European Computer Manufacturers Association, "ECMAScript for XML (E4X)", June 2004, <http://www.ecma.ch/ecma1/stand/ecma-357.htm>. [EcmaCompact] European Computer Manufacturers Association, "ECMAScript 3rd Edition Compact Profile", June 2001,<http://www.w3.org/TR/2001/REC-SVG-20010904/>.<http://www.ecma.ch/ecma1/stand/ecma-327.htm>. [JS15] Netscape Communications Corp., "Core JavaScript Reference 1.5", September 2000, <http://web.archive.org/*/http://devedge.netscape.com/libr ary/manuals/2000/javascript/1.5/reference/>. Hoehrmann ExpiresMarch 22, 2002August 9, 2005 [Page11]14] Internet-DraftJavaScript and ECMAScriptScripting Media TypesSeptember 2001 [WCAGTECHS] Chisholm, W., Vanderheiden, G. and I. Jacobs, "HTML Techniques for Web Content Accessibility Guidelines 1.0", November 2000, <http://www.w3.org/TR/WCAG10-HTML- TECHS/>.February 2005 [RFC2397] Masinter, L., "The "data" URL scheme", RFC 2397, August 1998. [RFC3236] Baker, M. and P. Stark, "The 'application/xhtml+xml' Media Type", RFC 3236, January 2002. [RFC3875] Robinson, D. and K. Coar, "The Common Gateway Interface (CGI) Version 1.1", RFC 3875, October 2004. [RFC3986] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005. [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, January 2005. Author's Address Bjoern Hoehrmannam Bededeich 7 D-25899 DagebuellWeinheimer Strasse 22 D-68309 Mannheim GermanyPhone: tel:+49-4667-981028 EMail: bjoern@hoehrmann.deEmail: mailto:bjoern@hoehrmann.de URI: http://bjoern.hoehrmann.deNOTE:Note: Please write "Bjoern Hoehrmann" with o-umlaut (U+00F6) wherever possible, e.g. as "Björn Höhrmann" in HTML and XML. Hoehrmann ExpiresMarch 22, 2002August 9, 2005 [Page12]15] Internet-DraftJavaScript and ECMAScriptScripting Media TypesSeptember 2001 Full CopyrightFebruary 2005 Intellectual Property StatementCopyright (C)TheInternet Society (2001). All Rights Reserved. This document and translationsIETF takes no position regarding the validity or scope ofit mayany Intellectual Property Rights or other rights that might becopied and furnishedclaimed toothers, and derivative works that comment on or otherwise explain it or assist in itspertain to the implementationmay be prepared, copied, published and distributed, in wholeorin part, without restrictionuse ofany kind, provided thattheabove copyright notice and this paragraph are included on all such copies and derivative works. However,technology described in this documentitself mayor the extent to which any license under such rights might or might not bemodified inavailable; nor does it represent that it has made any independent effort to identify anyway,suchas by removingrights. Information on thecopyright notice or referencesprocedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to theInternet SocietyIETF Secretariat and any assurances of licenses to be made available, orother Internet organizations, except as needed forthepurposeresult ofdeveloping Internet standards in which case the proceduresan attempt made to obtain a general license or permission forcopyrights defined intheInternet Standards process must be followed,use of such proprietary rights by implementers oras required to translate it into languages other than English. The limited permissions granted above are perpetual and will notusers of this specification can berevoked byobtained from theInternet Society orIETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to itssuccessorsattention any copyrights, patents orassigns.patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. Disclaimer of Validity This document and the information contained hereinisare provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCEDISCLAIMSDISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.AcknowledgementCopyright Statement Copyright (C) The Internet Society (2005). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. Acknowledgment Funding for the RFC Editor function is currently provided by the Internet Society. Hoehrmann ExpiresMarch 22, 2002August 9, 2005 [Page13]16] ----