-
Notifications
You must be signed in to change notification settings - Fork 902
Ask for confirmation, before loading burn after reading pastes #1237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Tobias Gurtzick <magic@wizardtales.com>
Signed-off-by: Tobias Gurtzick <magic@wizardtales.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM and a good idea and simple enough solution!
It's okay. The only thing to clarify could be to label the button explicitly "Yes, load and burn" or so.
That is a good idea and feature, actually, IMHO! |
As a recipient of the link, you only learned if the paste is burn after reading after loading it. The server knows (so they can delete it), but we would need to add an additional non-destructive API for the client to learn this, and that of course undermines the concept of not leaving a trace (but would let us add a counter: "This paste has been visited but not opened X amount of times") - Anyhow, I don't think it would be worth the extra risk and complexity. |
Ah okay, thanks. Then I mis-remembered that this may have been saved in the authenticated data part of the encryption. |
Upstream privatebin introduced this new feature PrivateBin/PrivateBin#1237 If the fragment contains a prefix character `-` , then the ui is supposed to warn before actyally getting paste, as the paste may be burn on read. This character can trip our reading of the bs58key. So, strip the prefix if found.
Hi, the top comment says a character "?" is inserted after the "#", but the code seems to use "#-" as prefix. Could you offer clarification on which character third party clients should look for? |
Upstream privatebin introduced this new feature PrivateBin/PrivateBin#1237 If the fragment contains a prefix character `-` , then the ui is supposed to warn before actyally getting paste, as the paste may be burn on read. This character can trip our reading of the bs58key. So, strip the prefix if found.
That was the initial suggestion, but after a discussion and considering various options and implication in the code review, we ended up changing it to the less ambiguous dash. Edit: I've now added a description how to generate the URL to the format doc. It covers both the regular and this new URL type and how they are intended to get used, but also clarified that this is optional. |
Thanks for the clarification! And the URL format description is very helpful. :) I understand this is already in production. But since it's relatively new, I wanted to ask what you think of having the character as a suffix, rather than prefix? Were there any strong arguments for having the character before the key and not after? If it's in the suffix, the scheme could be extended for other custom options. Clients could always rely on the key being present first after the |
Something like : Without custom options (current default):
With custom [client-side] options (hints):
Where client hints can be defined separately, and supporting them would be optional.
It's a breaking change regardless, because previously clients depended on the whole fragment being the key. |
I don't see how a character at the start or end makes it any simpler or more difficult to parse. Finding the optional extra char at the beginning or the end just changes your regex pattern or if you check first for the char and then for the base58 or the other way around. Hence I would not want to change it now, as it is already being used in the wild. Changing it would mean that your client now has to support both the 1.7 version of the URL and the new version you propose. |
I agree, for a single character it doesn't make a difference. What I was trying to convey was, if in the future there are more option characters, then with prefix, clients would have to update to support each new character, or they will break. Am sorry for not being able to convey properly before, let me try again. Say Privatebin 1.9 wants to introduce a character to warn that paste contains large attachment ( With suffix system, you could simply define fragment linearly with anchor char (
or treating fragment as csv
clients can then support upto index they know.
Having to index from behind is brittle since other programs or browsers can add spurious chars at the end of url. Basically, my suggestion is to keep the base58_key and any other option chars at fixed positive positions relative to the |
I would not recommend to index from behind either, because, as we had to learn, lot's of tracking-tools in chat-apps or "social" media will automatically add extra "GET-parameters" (ampersand followed by some key=value pairs) to the end of any URL-like string, even if that ends up being appended to the fragment and not to the query part of the URL. Instead I would parse it as follows:
Granted, I may have gotten exposed to too much C and too many char arrays, in recent years. I'm not aware of any plans to introduce any other special characters at this time and have so far myself not considered any other such items that we must pass via URL and can't introduce as paste parameters, either in the encrypted payload or the clear text adata. |
One argument that would indeed be a good one (IMHO) for putting the character at the end is that a knowledgable user can easier modify it (given some weird things do not add stuff there, but this is more a rare problem IMHO).
Similarly you can add the Also, it may be easier to see at the end instead of at the beginning – which in the URL is "inside some position in some wild letters". Also that behavior is known e.g. from URL shorteners, where https://is.gd/vrlkOW- gives you a preview page and shows the URL first, while https://is.gd/vrlkOW redirects directly. So this is just a slight UX argument here. |
This was already merged and has been in release 1.7.0 and 1.7.1 - if we change it, third party clients will have to support three styles, for the classic URL, the 1.7.x URL and the future URL. |
Update to this discussion. For future versions, we could support such client-side features using custom For example burn on read could be indicated as:
Example burn on read, and big attachment :
Backward compatibility:
|
Note re above: We may have to change the delimeter ( |
@nain-F49FF806 Good point and thanks for the information. (though AFAIK browsers may do stuff with fragments itself, so we need to see). Anyway, could you please create a new issue for that, so it is not lost? Thanks! |
This PR is derived from #1231 but with a slightly less complex goal.
When creating burn after reading pastes, a "?" is inserted at the start of the URL fragment (.../?aaaa#bbbb becomes .../?aaaa#**?**bbbb). This way the server doesn't get sent this, though it still knows that the paste is of the burn after reading type. If this character is detected upon loading a paste, the user is asked to confirm loading it, by clicking a button:
While this is done automatically for burn after reading pastes, it doesn't prevent anyone from manually adding it to a regular URL to get it to ask for non burn after reading pastes (hence the slightly vague message) or removing it from burn after reading URL to instantly load it, if this isn't required.
Changes
ToDo