[widgets] The access element (was: RE: Reminder: January 31 comment deadline for LCWD of Widgets 1.0: Packaging & Configuration spec)

Hi All,

In the email [1] containing my comments against the LCWD of Widgets 1.0:
Packaging & Configuration spec, I wrote:

>> 7.10 The access Element 
>> The access element defines a network attribute as "A boolean
attribute 
>> that indicates that the widget might need to access network resources

>> as specified in [Widgets-Security]. "
>> 
>> Based on this description we would like to make the following 
>> observations and suggestion:
>> 
>> The access element contains security permissions that will be used as

>> hooks in the yet to be written [Widgets-Security] specification. The 
>> problem is that the permissions haven't yet been discussed in detail 
>> and so we may find that we want to represent additional context other

>> than a black and white "is network access required?". For example, it

>> may be the case that it is important from a security point of view to

>> know which bearer or protocol will be used, or to nest a set of 
>> domains/URLs with which the widget wants to communicate. I do not
have 
>> a strong view on what might be relevant here, and I am not suggesting

>> that it needs to be considered as part of the last call of the 
>> Packaging and Configuration spec, only that it is likely that the 
>> permission will need to be more complex when we look at it from a
security perspective.

Marcos replied:

> I think we better start this soon, then. My feeling is that we will
need some kind of <domain> access declarations, and I would like to see
them in the > configuration document.

My follow up:

Marcos makes the suggestion that he would like to see the access element
replaced/extended with domains. Vodafone have come to a similar
conclusion. We feel that a widget author should be able to declare the
hosts with which they want to communicate. The widget should then only
be allowed to communicate with those hosts. 

This is beneficial for two reasons: 

1.) It allows the widget author to practice the principle of least
privilege, limiting the potential attack space 

2.) It allows other parties (users, widget distributors, consuming
widget user agents) to inspect the widget to get some idea of who the
widget will communicate with, thereby enabling more sensible security
decisions to be made.

There is however one exception that we would like to enable, the ability
for a widget author to indicate that their widget might be expected to
communicate with any host. This is to allow for use cases such as widget
RSS readers. We would therefore like to propose that the access element
is extended along the following lines:

<access>

    <network any-host="true/false">

        <target host="somehost.com" />

        <target host="en.anotherurl.com" />

    </network>

</access>

Declaring <network any-host="true"/> would mean that regardless of
whether the network element contained any child domain elements, the
author was declaring that they wanted access to any host (note that by
default this value would be "false" so only authors who wanted access to
any host would be inclined to use it). 

There is IMO an open question as to whether it would better to specify: 

1. full URLs in place of hostnames, eg:

<target url="http://somehost.com" />

2. hostnames (to allow for use of http and https and other protocols
without requiring multiple declarations), maybe by using an additional
attribute, eg:

<target host="somehost.com" protocol="http"/>

3. hostnames + paths (to allow authors to restrict access to specific
resources)

<target host="somehost.com" protocol="http" path="/images"/>

Related to the above options is whether or not the omission of protocols
and paths could/should be specified to mean "any value". This would
allow a certain degree of flexibility while still allowing the author to
lock things down if they wanted.

I would like to also bring it to the group's attention that BONDI have
also identified this as an issue and have specified something similar to
the proposal above - see [2] section 3.3.4 - as an extension to the W3C
configuration document. 

Ignoring where the element is located and the additional attributes, the
main difference between the BONDI approach and the approach that I have
outlined here is that BONDI does not restrict the widget to only access
those hosts declared but instead uses the declarations as values to
evaluate within the security policy. This is an advantage in one respect
as it allows a lot of flexibility - the policy can restrict the widget
to only the declared hosts, or the declared hosts plus a whitelist of
safe hosts etc, and can also control whether or not wildcarding is
allowed. 

However, I would argue that the BONDI approach also presents a
significant disadvantage, namely that in relying on the security policy
of the consuming device to interpret the declared targets, the behaviour
is unpredictable for the widget author, distributor and potentially the
user. This is the main reason that I am not suggesting that the BONDI
approach is adopted as is. I will also cross post this email to the
BONDI list to get feedback. Speaking from a Vodafone perspective and as
someone who participates in both W3C WebApps and BONDI, ideally we would
like to see the solution specified in W3C and then simply referenced in
BONDI. With BONDIs current specifications being at Candidate Release
status until the 9th March there is still a good opportunity to achieve
this kind of alignment.

I realise that it's late in the day to be specifying new elements but I
think there are real advantages to extending the access element in the
way proposed and it addresses a real use case.

As always, comments, questions and suggestions are welcomed!

Thanks,

Mark

[1] http://www.mail-archive.com/public-webapps@w3.org/msg02058.html

[2]
http://bondi.omtp.org/Documents/CR10/BONDI_Architecture_Security_Task_CR
10.pdf

 




 

>-----Original Message-----
>From: Marcos Caceres [mailto:marcosscaceres@gmail.com] 
>Sent: 04 February 2009 17:35
>To: Priestley, Mark, VF-Group
>Cc: Arthur Barstow; public-webapps
>Subject: Re: Reminder: January 31 comment deadline for LCWD of 
>Widgets 1.0: Packaging & Configuration spec
>
>Hi Mark,
>On Thu, Jan 29, 2009 at 6:29 PM, Priestley, Mark, VF-Group 
><Mark.Priestley@vodafone.com> wrote:
>>
>> Hi Marcos, Art, All,
>>
>> Please find below Vodafone's comments on the Widgets 1.0: Packaging 
>> and Configuration specification. I have divided them into what I 
>> consider to be substantive comments and editorial comments.
>>
>> Thanks,
>>
>> Mark
>>
>>
>> 
>----------------------------------------------------------------------
>> --
>> ----------------------
>> Substantive comments
>> 
>----------------------------------------------------------------------
>> --
>> ----------------------
>> Step 5 Process the Digital Signatures
>>
>> We disagree with the stage 2, specifically "If the file entry is 
>> deemed by the [Widgets-DigSig] to be an invalid widget, then 
>a widget 
>> user agent must treat this widget as an invalid widget.", on 
>two grounds:
>>
>> (1) Because one signature is invalid it doesn't mean that all of the 
>> signatures are invalid;
>> (2) Just because one signature or all signatures are invalid 
>does not 
>> mean that the widget should not be installed, only that it should 
>> _not_ be treated as a signed widget. The security policy of 
>the device 
>> might be configured not to install an unsigned widget or a 
>widget with 
>> an invalid signature but this should be dependent on the security 
>> policy implemented.
>
>Sorry, I think you might have misunderstood what I was trying 
>to say here (probably I did not write it clearly enough). This 
>assertion is here to deal with instances where the digital 
>signature deemed by the Widgets Dig Sig spec to be somehow 
>fully broken or completely non-conforming in such a way that 
>all processing must stop. I don't yet know if Widgets Dig Sig 
>will spit out such a result for any digsig it is processing, 
>but it seemed like a good idea to put this in here at the time.
>
>In other words, this is something that is controlled by the 
>Widgets Dig Sig spec. If it turns out that Widgets Dig Sig 
>never results in an invalid widget situation, then I will take 
>this out. I've created a red note in the spec that says 
>"Issue: [Widgets-DigSig] may never identify a widget package 
>as invalid" as a reminder that we need to sort this out.
>
>FWIW, I think step 5  is buggy and needs a rewrite (I've added 
>another issue to the spec stating as such). I'll need to work 
>with you to fix it as we progress the Dig Sig spec.
>
>> -----------------------------------------------
>> Step 4 Locate Digital Signatures for the Widget
>>
>> I'm not sure whether the packaging and configuration 
>specification is 
>> the correct place to do this but IMHO there needs to be a statement 
>> that a files with a file name corresponding to the naming convention 
>> for digital signatures are not accessible from the widget once the 
>> widget is installed / instantiated. Failure to impose this 
>restriction 
>> will make it possible to include a signature and then reference it 
>> from the signed code, which presents a security hole.
>
>Good point. This seems like something that needs to be in the 
>yet to be written a widget runtime security spec.  I've added 
>an issue note to the spec so we don't forget about this.
>
>Just out of interest, can you present the nature of the security hole?
>i.e., once an attacker has the signature, say, via an XSS 
>attack, what could they do with it?
>
>> -----------------------------------------------
>> 7.10 The access Element
>>
>> The access element defines a network attribute as "A boolean 
>attribute 
>> that indicates that the widget might need to access network 
>resources 
>> as specified in [Widgets-Security]. "
>>
>> Based on this description we would like to make the following 
>> observations and suggestion:
>>
>> The access element contains security permissions that will 
>be used as 
>> hooks in the yet to be written [Widgets-Security] specification. The 
>> problem is that the permissions haven't yet been discussed in detail 
>> and so we may find that we want to represent additional 
>context other 
>> than a black and white "is network access required?". For 
>example, it 
>> may be the case that it is important from a security point 
>of view to 
>> know which bearer or protocol will be used, or to nest a set of 
>> domains/URLs with which the widget wants to communicate. I 
>do not have 
>> a strong view on what might be relevant here, and I am not 
>suggesting 
>> that it needs to be considered as part of the last call of the 
>> Packaging and Configuration spec, only that it is likely that the 
>> permission will need to be more complex when we look at it 
>from a security perspective.
>
>I think we better start this soon, then. My feeling is that we 
>will need some kind of <domain> access declarations, and I 
>would like to see them in the configuration document.
>
>__This has the potential to block progress of this specification.__
>
>> There is also the case in which the network permission may 
>be used to 
>> determine whether or not the user wants to install a widget,
>
>This sounds reasonable.
>
>> or by the
>> widget user agent may want to indicate whether or not the widget can 
>> run when there is no available network connection. Some widgets may 
>> only operate when there is a network connection, whereas others may 
>> degrade gracefully.
>
>This sounds like something authors need to deal with, not user agents.
>
>> So to provide a degree of future-proofing we would like to suggest 
>> something like:
>>
>> <access>
>>    <network use="true/false" required="true/false"/> </access>
>
>We might not need this at all, actually: If we go down the 
>declaring domain route, then network is off unless a domain is 
>declared.
>
>> (I realise that the "use" attribute in the above example is 
>a horrible 
>> name but I couldn't think of another word for access...There are 
>> probably also better ways of capturing the meaning - we open to 
>> suggested improvements)
>
>This needs further discussion.
>
>> Sorry for not raising this earlier but it has only become apparent 
>> when considering in more detail how the access element would be used.
>
>No probs.
>
>>
>> 
>----------------------------------------------------------------------
>> --
>> ----------------------
>> Editorial comments
>> 
>----------------------------------------------------------------------
>> --
>> ----------------------
>> 6 Widget Resources
>>
>> First 5 bullets should say "and/or" rather than "or" ?
>
>"Zero and/or more" sounds weird to me (i.e., "Zero and more"). 
>If you feel strongly about this, I will change it; otherwise, 
>I would prefer to leave it as is.
>
>> -----------------------------------------------
>> 6.5 Content Localization
>>
>> "The container for localized content is a folder at the root of the 
>> widget whose the first five characters of the folder-name case 
>> insensitively match the string 'locales/'." Why the first five 
>> characters only?
>
>That was a mistake, the sentence now reads:
>"The container for localized content is a folder at the root 
>of the widget whose folder-name case insensitively match the 
>string 'locales/'. A container for localized content may 
>contain zero or more localized folders."
>
>> Also sentence has an extra "the" in the middle, i.e. "whose 
>*the* first"
>
>fixed.
>
>> -----------------------------------------------
>> 6.6 Start file and Default Start Files Sentence
>>
>> For consistency with other sections I suggest to add:
>>
>> "A default start file is a start file whose file-name case 
>> insensitively matches a file-name given in the first column of the 
>> default start files below and whose MIME type matches the MIME type 
>> given in the second column of the table."
>>
>> before the sentence starting: "A default start file is a start file 
>> that a widget user agent..."
>
>Ok, I think there was a more significant problem: I've defined 
>"custom start files" and "default start files". As a result, I 
>changed that whole section.
>
>> And then to combine the last two sentences before the default start 
>> files table to:
>>
>> "A widget user agent will attempt to locate a file entry whose 
>> file-name case insensitively matches one of the default start files 
>> based on the order they appear in the table below (from top 
>to bottom). "
>
>Can you please check that section again and let me know if the 
>rewrite is ok?
>
>> -----------------------------------------------
>> 7.1 Namespace
>>
>> It seems a bit tough that an invalid configuration document 
>results in 
>> a invalid widget as the configuration document is optional. Also, if 
>> the configuration document in the localised folder is invalid, it 
>> could be the case that there is a valid configuration 
>document at the 
>> root of the widget.
>>
>> I don't have a strong opinion on this and have no objection 
>to leaving 
>> the text as it is, I just wondered if there was a reason why this 
>> approach had been taken?
>
>Although I agree that it's a bit cruel on developers, we made 
>this decision to make the behavior of configuration documents 
>predictable.
>I feel pretty strongly that we should leave it as is.
>
>> -----------------------------------------------
>> 7.2 Proprietary Extensions
>>
>> Should the "may" be a "should"? Otherwise, it could be 
>interpreted as 
>> suggesting that vendors may equally use other approaches?
>
>Right, fixed. This should, in fact, be a must (i.e., if you 
>want to extend, then you must use your own namespace).
>
>> -----------------------------------------------
>> 7.9 The icon Element
>>
>> (disclaimer - I may well be talking rubbish here as the following 
>> comments are based on a _very_ basic understanding of graphics 
>> formats)
>>
>> The text says that if the icon is vector format then the height and 
>> width attributes will be used, however, isn't one the point of using 
>> vector graphics that they could be re-sized to fit the 
>available space.
>
>Yes and no. Beyond certain sizes (e.g., too little, too big), 
>the rendering engine may have undesirable effects on a design 
>(think, for example, of a really tiny font having anti-alias 
>applied to it:
>because of sub-pixel interpolation, it becomes too blurry to 
>read. The same can happen with graphics, very thin lines can 
>vanish or become blurry, which can make a design look crappy). 
>In such cases, it may be desirable to use a bitmap.
>
>> Therefore shouldn't there be a statement saying that the widget user 
>> agent MAY ignore these values?
>
>No, the width and height attributes represent the _minimum_ 
>size at which an image may be used. Then, the vector graphic 
>can behave in the manner you describe (i.e., can be used to 
>fill a rendering context larger than the width and height).
>
>>Equally should there be default sizes in case the attribute 
>is not used?
>
>Hmm... good point. I've added that as an issue in the relevant section.
>
>> In terms of raster graphics the text currently says "If the file 
>> pointed to by the src is a supported raster graphic, this 
>value may be 
>> ignored by the widget user agent." but shouldn't the "may" in this 
>> case be a "should"?
>
>Correct, but that "should" should be a "must". Fixed.
>
>> -----------------------------------------------
>> 7.13 The feature Element
>>
>> In the sentence "The feature is used by an author to denote that, at 
>> runtime, a widget may require access to a feature." the use of "may 
>> require" is very slightly confusing given that the next attribute is 
>> "required". Suggest changing "require" to "try to" or "attempt to".
>
>Changed "require" to "attempt to".
>
>> Likewise in the definition of the name attribute in the sentence "A 
>> URI attribute that identifies a feature required by the widget at 
>> runtime (such as an API)." change "required by" to "that may 
>be used".
>
>Done.
>
>> -----------------------------------------------
>> 8 Steps for Processing a Widget Resource
>>
>> The sentence "The steps for processing a widget resource 
>involves ten 
>> steps that a widget user agent must follow, in sequential order, 
>> responding accordingly if any of the steps result in an 
>error." could 
>> be slightly misleading as some of the steps are skipped depending on 
>> the processing in a preceding step. I'm not sure if this is 
>always in 
>> a response to an error?
>
>Ok, I changed it to: "The steps for processing a widget 
>resource involves ten steps that a user agent must follow, in 
>sequential order, responding accordingly if any of the steps 
>result in an error or if the specification asks for the user 
>agent to skip a step."
>
>Is that any better?
>
>> A minor comment on section 8 as a whole - some of the steps have an 
>> explicit link to go to the next step while others (like 9) don't. It 
>> would be nice if this was consistent.
>
>Ok, I checked every step and made sure things are consistent. 
>Once all the comments are done, I'll do another editorial 
>round to make sure everything is more consistent.
>
>> In addition, some of the algorithms, for example step 7, 
>could be made 
>> clearer by explicitly stating when to go to the next step (i.e. in 
>> case of success in 7.1 and 7.2).
>
>Ok, I did what you said for step 7 and Step 8. Can you let me 
>know which other ones need a rewrite?
>
>> Finally, in Step 6 there is a sentence "Else, remove the last subtag 
>> of the range and repeat this step 2.d. (e.g., if the range 
>...". Just 
>> to be super clear perhaps "this step 2.d." could be change 
>to "and go 
>> to 2.d of this algorithm"
>
>Made the change you suggested.
>
>Very much appreciate Vodafone taking the time to conduct this review.
>
>Kind regards,
>Marcos
>--
>Marcos Caceres
>http://datadriven.com.au
>

Received on Thursday, 19 February 2009 20:06:50 UTC