Skip to content
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

Bug/19702 bbq.js proto secure #4563

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

kevin-foster-uk
Copy link

@kevin-foster-uk kevin-foster-uk commented Sep 9, 2024

This PR fixes a security issue reported to LimeSurvey (https://bugs.limesurvey.org/view.php?id=19702).

We have patched jquery-bbq.js to prevent injection of proto.

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Tests pass? ❌ (tests are failing but its not related to this PR)

Copy link
Member

@Arhell Arhell left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@marcovtwout marcovtwout left a comment

Choose a reason for hiding this comment

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

The LimeSurvey link is not available without logging in. Is there a public version?

The source change looks good but there are some points to address.

framework/web/js/source/jquery.ba-bbq.js Outdated Show resolved Hide resolved
framework/web/js/source/jquery.ba-bbq.js Show resolved Hide resolved
framework/web/js/source/jquery.ba-bbq.min.js Outdated Show resolved Hide resolved
@kevin-foster-uk
Copy link
Author

kevin-foster-uk commented Sep 18, 2024

The LimeSurvey link is not available without logging in. Is there a public version?

The source change looks good but there are some points to address.

Login is required but it is open for anyone to create an account. You just need to provide a username and email address.

@marcovtwout
Copy link
Member

marcovtwout commented Sep 18, 2024

I checked the upstream project where this issue was also found, but never fixed fully. For the sake of any other projects using jquery-bbq, I suggest to share your solution upstream also.

Links:

Other noteworthy info:

framework/web/js/source/jquery.ba-bbq.min.js Show resolved Hide resolved
@@ -465,7 +465,9 @@
// (Object) An object representing the deserialized params string.

$.deparam = jq_deparam = function( params, coerce ) {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps you can add a comment header block in the first lines of this file, stating the changes made compared to 1.4pre. Something along the lines of:

Additional changes to this file:

- Removed support for IE8 and below
- Fixed prototype pollution (CVE-2021-20086)

Copy link
Author

@kevin-foster-uk kevin-foster-uk Oct 4, 2024

Choose a reason for hiding this comment

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

I add a doc block near the top of the file:

/* 
 * Additional changes to this file:
 * - Removed support for IE8 and below
 * - Fixed prototype pollution (CVE-2021-20086)
 * - Minified with `uglifyjs jquery.ba-bbq.js --compress -o jquery.ba-bbq.min.js`
 */

@@ -1,18 +1,17 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps add an addition comment that says:

Manually re-uglified with `uglifyjs jquery.ba-bbq.js --compress -o jquery.ba-bbq.min.js`

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that such information should be in minified version. If we want to document how to minify it it the future, it should be rather in source file.

Copy link
Author

Choose a reason for hiding this comment

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

I added this information in the a new doc block in the source file and also added that same doc block to the minified file.

@marcovtwout
Copy link
Member

marcovtwout commented Oct 3, 2024

@kevin-foster-uk could you look at the above? When this PR is done I can prepare a new yii release.

@kevin-foster-uk
Copy link
Author

@kevin-foster-uk could you look at the above? When this PR is done I can prepare a new yii release.

Sorry for the delay I have been on vacation. Will update asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants