Skip to content

Tests: Strip untypical callback parameter characters from mock.php #4871

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

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

mgol
Copy link
Member

@mgol mgol commented Apr 9, 2021

Summary

Strip untypical callback parameter characters from mock.php.
Only allow alphanumeric characters & underscores for callback parameters.
The change is done both for the PHP server as well as the Node.js-based version.
This is only test code so we're not fixing any security issue but it happens
often enough that the whole jQuery repository directory structure is deployed
onto the server with PHP enabled that it makes is easy to introduce security
issues if this cleanup is not done.

Ref gh-4764

I'd like to also merge a version of this to the 2.2-stable & 1.12-stable branches as the jsonp.php file has the same issues as mock.php with some action parameters.

Checklist

Sorry, something went wrong.

@mgol mgol added this to the 3.6.1 milestone Apr 9, 2021
@mgol mgol requested review from Krinkle and timmywil April 9, 2021 12:12
@mgol mgol self-assigned this Apr 9, 2021
@mgol mgol marked this pull request as draft April 9, 2021 12:16
@mgol mgol changed the title Tests: Strip non-alpha-numeric callback parameter values from mock.php Tests: Strip untypical callback parameter characters from mock.php Apr 9, 2021
@mgol mgol marked this pull request as ready for review April 9, 2021 13:00
@mgol mgol force-pushed the clean-callback branch from de0be5b to 8fb7f22 Compare April 9, 2021 13:00
Only allow alphanumeric characters & underscores for callback parameters.
The change is done both for the PHP server as well as the Node.js-based version.
This is only test code so we're not fixing any security issue but it happens
often enough that the whole jQuery repository directory structure is deployed
onto the server with PHP enabled that it makes is easy to introduce security
issues if this cleanup is not done.

Ref jquerygh-4764
@mgol mgol force-pushed the clean-callback branch from 8fb7f22 to 2a6cb73 Compare April 9, 2021 13:02
Copy link
Member

@timmywil timmywil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also in favor of making these changes in 1.x/2.x

@mgol mgol removed the Needs review label Apr 13, 2021
@mgol mgol merged commit a702746 into jquery:main Apr 13, 2021
@mgol mgol deleted the clean-callback branch April 13, 2021 20:13
mgol added a commit that referenced this pull request Apr 13, 2021
Only allow alphanumeric characters & underscores for callback parameters.
The change is done both for the PHP server as well as the Node.js-based version.
This is only test code so we're not fixing any security issue but it happens
often enough that the whole jQuery repository directory structure is deployed
onto the server with PHP enabled that it makes is easy to introduce security
issues if this cleanup is not done.

Ref gh-4764
Closes gh-4871

(cherry picked from a702746)
mgol added a commit to mgol/jquery that referenced this pull request Apr 16, 2021
Only allow alphanumeric characters & underscores for callback parameters.
This is only test code so we're not fixing any security issue but it happens
often enough that the whole jQuery repository directory structure is deployed
onto the server with PHP enabled that it makes is easy to introduce security
issues if this cleanup is not done.

This is a 1.x/2.x version of pR jquerygh-4871

Ref jquerygh-4764
Ref jquerygh-4871
mgol added a commit to mgol/jquery that referenced this pull request Apr 16, 2021
Only allow alphanumeric characters & underscores for callback parameters.
This is only test code so we're not fixing any security issue but it happens
often enough that the whole jQuery repository directory structure is deployed
onto the server with PHP enabled that it makes is easy to introduce security
issues if this cleanup is not done.

This is a 1.x/2.x version of PR jquerygh-4871.

The change doesn't require a release; it's meant at installations testing
the latest state of `1.12-stable` & `2.2-stable` branches.

Ref jquerygh-4764
Ref jquerygh-4871
@mgol
Copy link
Member Author

mgol commented Apr 16, 2021

A version for the 1.12-stable & 2.2-stable branches: #4875.

mgol added a commit to mgol/jquery that referenced this pull request Apr 16, 2021
Only allow alphanumeric characters & underscores for callback parameters.
This is only test code so we're not fixing any security issue but it happens
often enough that the whole jQuery repository directory structure is deployed
onto the server with PHP enabled that it makes is easy to introduce security
issues if this cleanup is not done.

This is a 1.x/2.x version of PR jquerygh-4871.

The change doesn't require a release; it's meant at installations testing
the latest state of `1.12-stable` & `2.2-stable` branches.

This change also fixes testing on Travis & on Chrome/Firefox.

Ref jquerygh-4764
Ref jquerygh-4871
mgol added a commit that referenced this pull request Apr 29, 2021
Only allow alphanumeric characters & underscores for callback parameters.
This is only test code so we're not fixing any security issue but it happens
often enough that the whole jQuery repository directory structure is deployed
onto the server with PHP enabled that it makes is easy to introduce security
issues if this cleanup is not done.

This is a 1.x/2.x version of PR gh-4871.

The change doesn't require a release; it's meant at installations testing
the latest state of `1.12-stable` & `2.2-stable` branches.

This change also fixes testing on Travis & on Chrome/Firefox.

Closes gh-4875
Ref gh-4764
Ref gh-4871
mgol added a commit to mgol/jquery that referenced this pull request Apr 29, 2021
Only allow alphanumeric characters & underscores for callback parameters.
This is only test code so we're not fixing any security issue but it happens
often enough that the whole jQuery repository directory structure is deployed
onto the server with PHP enabled that it makes is easy to introduce security
issues if this cleanup is not done.

This is a 1.x/2.x version of PR jquerygh-4871.

The change doesn't require a release; it's meant at installations testing
the latest state of `1.12-stable` & `2.2-stable` branches.

This change also fixes testing on Travis & on Chrome/Firefox.

Closes jquerygh-4875
Ref jquerygh-4764
Ref jquerygh-4871

(cherry picked from acb7c49)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants