Bug 7380 - Internal error 500 on invalid loginsubmit URL parameter to webaccess
Summary: Internal error 500 on invalid loginsubmit URL parameter to webaccess
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Web Access (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.11.0
Assignee: Samuel Mannehed
URL:
Keywords: ossman_tester, prosaic
Depends on:
Blocks:
 
Reported: 2019-09-18 12:33 CEST by Samuel Mannehed
Modified: 2019-09-25 15:28 CEST (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Samuel Mannehed cendio 2019-09-18 12:33:19 CEST
If you supply an invalid value to loginsubmit as an URL parameter you will get an internal error as well as a traceback in the log.

To reproduce you can add this to the webaccess urul:

"?loginsubmit=somethingThatIsntAnumber"

Like this:

https://tl.cendio.se:300/main/?loginsubmit=a1


This is the traceback in the log:


2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1] ----------------------------------------
2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1] Traceback (most recent call last):
2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1]   File "/opt/thinlinc/sbin/tlwebaccess", line 275, in post_or_get
2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1]     Ii1I , ooo00OOOooO = getattr ( oOOo0 , action ) ( OOoO , oooooOoo0ooo , Ii1I )
2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1]   File "/opt/thinlinc/modules/thinlinc/tlwebaccess/tlwebsvcmain.py", line 107, in do_GET
2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1]     self . _GET_METHODS . get ( page_name , self . error_404 ) ( query ) )
2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1]   File "/opt/thinlinc/modules/thinlinc/tlwebaccess/main.py", line 75, in home
2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1]     loginsubmit = query.get("loginsubmit", [0])[0]
2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1] ValueError: invalid literal for int() with base 10: 'a1'
2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1] ----------------------------------------
2019-09-18 12:30:34 ERROR tlwebaccess[23990]: [::1] code 500, message Internal error on page '/main/?loginsubmit=a1'
2019-09-18 12:30:34 INFO tlwebaccess[23990]: [::1] 'GET /main/?loginsubmit=a1 HTTP/1.1' 500 -
Comment 2 Samuel Mannehed cendio 2019-09-18 14:19:45 CEST
This should be fixed now. Test by adding loginsubmit to the URL with a value that can't be casted to an int.
Comment 3 Pierre Ossman cendio 2019-09-25 15:28:41 CEST
Looks good and seems to work well.

Note You need to log in before you can comment on or make changes to this bug.