You are here: Foswiki>Tasks Web>Item1922 (13 Aug 2009, PhilippLeufke)Edit Attach

Item1922: CSRF Confirmation Dialog messes up retarded execution macros

pencil
Priority: Normal
Current State: No Action Required
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: PhilippLeufke
Waiting For:
Last Change By: PhilippLeufke

Short description

The new CSRF security feature of 1.0.6 which asks for confirmation when saving a topic (see: WhyYouAreAskedToConfirm) can mess up topic content.

How to reproduce

So far we encountered this problem when using retarded macros, e.g. a CALC embedded in a SEARCH. To provoke the CSRF Confirmation Dialog, in our case it't enough to use the browsers back button after a topic was saved and save it again.

Example

Create a test topic with the following content:
%SEARCH{
"form.name ~ '*UserForm'"
type="query"
web="Main"
separator=", "
format="$percntCALC{$PROPERSPACE($topic)}$percnt"
}%

  • After saving you will see a comma separated list of users, with spaced-out names.
  • Now go back in your browser, save again and click OK in the Confirmation Dialog.
  • Now the list of users will only feature the WikiNames without spaces.
  • A click on Raw View will show you, that the embedded CALC vanished:
%SEARCH{
"form.name ~ '*UserForm'"
type="query"
web="Main"
separator=", "
format="$topic"
}%

Another nice example is (if you have ForEachPlugin installed):
%FOR{"counta" start="1" stop="10" step="1"}%
   * $percntCALC{$SETIFEMPTY(ind,0) $SETM(ind, + $counta) $GET(ind)}$percnt
%NEXT{"counta"}%
This will result in
%FOR{"counta" start="1" stop="10" step="1"}%
   *   ERROR: syntax error, at EOF
%NEXT{"counta"}%

Strange, isn't it?

System Info

  • most recent Debian packages
  • {Validation}{Method} is set to strikeone


Dupliacte of Item1921.

-- GilmarSantosJr - 13 Aug 2009

Yes. Sorry about that. This was because the browser's back button was used and the topic was saved again, which caused it to be saved thrice...

-- PhilippLeufke - 13 Aug 2009

ItemTemplate edit

Summary CSRF Confirmation Dialog messes up retarded execution macros
ReportedBy PhilippLeufke
Codebase 1.0.6
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r3 - 13 Aug 2009, PhilippLeufke
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy