Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027036Openbravo ERPC. Securitypublic2014-07-09 09:532014-08-08 18:53
alostale 
alostale 
immediatemajorhave not tried
closedfixed 
5
 
3.0PR14Q43.0PR14Q4 
AugustoMauch
Core
No
0027036: 2 roles accessing WS from same browser can temporarily mess up WS access
When accessing web services and ERP at the same time from the same browser, it is possible temporarily mess up user and roles to access web service.
1. Set up instance:
  *Create role A with access to Currency and access to Web Services, assign it to user A as default role
  *Create role B without access to Web Services
2. Invoke Currency WS (/ws/dal/Currency) as user A -> retrieves data, OK
3. In the same browser log in ERP with user B
4. Log out
5. Invoke Currency WS as role A from a different browser -> It won't retrieve data in the next 30 min
The problem is as follows:
-WS keep a cache of OBContext associated to userId in order to allow stateless requests
-In step 2 a new entry (user A, context for role A) is created in this cache
-In step 3 the cache is not modified but the context object referred from it is changed to context for role B
-In step 5 value for user A is requested from cache, it returns object pointing now to context for role B, which has no access to ws
No tags attached.
Issue History
2014-07-09 09:53alostaleNew Issue
2014-07-09 09:53alostaleAssigned To => alostale
2014-07-09 09:53alostaleModules => Core
2014-07-09 09:53alostaleTriggers an Emergency Pack => No
2014-07-09 09:53alostaleReview Assigned To => AugustoMauch
2014-07-09 10:00hgbotCheckin
2014-07-09 10:00hgbotNote Added: 0068566
2014-07-09 10:00hgbotStatusnew => resolved
2014-07-09 10:00hgbotResolutionopen => fixed
2014-07-09 10:00hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9f64b28414de37634b6617f8af82f5416f07084a [^]
2014-07-14 10:37AugustoMauchNote Added: 0068605
2014-07-14 10:37AugustoMauchStatusresolved => closed
2014-07-14 10:37AugustoMauchFixed in Version => PR14Q4
2014-07-16 13:36hgbotCheckin
2014-07-16 13:36hgbotNote Added: 0068665
2014-08-08 18:52hudsonbotCheckin
2014-08-08 18:52hudsonbotNote Added: 0069147
2014-08-08 18:53hudsonbotCheckin
2014-08-08 18:53hudsonbotNote Added: 0069172

Notes
(0068566)
hgbot   
2014-07-09 10:00   
Repository: erp/devel/pi
Changeset: 9f64b28414de37634b6617f8af82f5416f07084a
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jul 09 09:56:55 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9f64b28414de37634b6617f8af82f5416f07084a [^]

fixed bug 27036: browser combined ws and erp access can mess up ws roles

  Before getting the OBContext from cache ensure the user id it was cached for
  is still the current one. Note this can change in case of accessing from same
  browser with existent session using different users

---
M src/org/openbravo/service/web/UserContextCache.java
---
(0068605)
AugustoMauch   
2014-07-14 10:37   
Code reviewed and verified in pi@119c05bb76af
(0068665)
hgbot   
2014-07-16 13:36   
Repository: erp/devel/pi
Changeset: 32a0d7f3914799ae6f850266e2c523e63ed24e7c
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jul 16 13:36:03 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/32a0d7f3914799ae6f850266e2c523e63ed24e7c [^]

related to bug 27036: added additional debug log

---
M src/org/openbravo/service/web/BaseWebServiceServlet.java
M src/org/openbravo/service/web/UserContextCache.java
---
(0069147)
hudsonbot   
2014-08-08 18:52   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/4450016dee64 [^]
Maturity status: Test
(0069172)
hudsonbot   
2014-08-08 18:53   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/4450016dee64 [^]
Maturity status: Test